Hi All, Please help me with the segment code | Community
Skip to main content
somasundaramb
Level 2
March 23, 2018
Solved

Hi All, Please help me with the segment code

  • March 23, 2018
  • 4 replies
  • 5621 views

Hi All,

When i'm executing a delivery, i'm unable proceed without a segment code(Targeting activities like split, union and intersection has separate segment code).

I come up with two solution for this.

1. I can make the segment code as mandatory field in the Out of Box form(OOB Form). But it might affect my existing campaign/deliveries that doesn't have segment code.

2. I can apply typology rule to exclude the recipient who doesn't have the segment code. Since Split, Union activities segment code are in stored in temporary table. any idea to fetch the data from temporary table? refer the 3rd image  (I would like to go with 2nd option).

I have attached 3 images. my sample work flow.

Split activity where we can find segment code.

Temp table of split activity.

Little help on this much appreciated.

Thanks

Soma

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kapil_Sharma_

Hi Soma,

I don't think we can create a typology based on the Segment Code, as this column comes in Temporary Schema and it's not saved in the database. Typology Rules can only be created on the columns which are in the Database Schemas or you can write one JavaScript code. But the problem in writing the JS is that you can check whether the recipients have SegmentCode value or not but you can't filter them out.

There may be some way to create Typology for this, but I am not aware of that.

So, if you want to send delivery only to the recipients who have Segment Code value, one solution can be :

Yes, you are correct that each activity has it's own Segment Code.

But, all the Segment Codes have same Alias as well as Column Name in the Temp Schema i.e. Segment code (@segmentCode).

So, before the delivery you can have one split activity, in which you can filter out the recipients who have Segment Code as Empty and send the delivery to only those which have Segment Code value populated.

4 replies

Kapil_Sharma_
Adobe Employee
Adobe Employee
March 23, 2018

Hi Soma,

Can you please tell me what exactly is the error you are getting while executing the delivery without the Segment Code, because Segment Code is not a mandatory thing for the delivery to execute ?

somasundaramb
Level 2
March 25, 2018

Hi Kapil,

Thanks for jump in. I want to make the segment code as mandatory for delivery. Recipient who is having segment code, he/she should get the delivery, that is my acceptance criteria.  I need to do it by applying typology rule. Since the segment codes are unique to every activities, split, union, intersection, I wonder how to apply typology here.

Kapil_Sharma_
Adobe Employee
Kapil_Sharma_Adobe EmployeeAccepted solution
Adobe Employee
March 26, 2018

Hi Soma,

I don't think we can create a typology based on the Segment Code, as this column comes in Temporary Schema and it's not saved in the database. Typology Rules can only be created on the columns which are in the Database Schemas or you can write one JavaScript code. But the problem in writing the JS is that you can check whether the recipients have SegmentCode value or not but you can't filter them out.

There may be some way to create Typology for this, but I am not aware of that.

So, if you want to send delivery only to the recipients who have Segment Code value, one solution can be :

Yes, you are correct that each activity has it's own Segment Code.

But, all the Segment Codes have same Alias as well as Column Name in the Temp Schema i.e. Segment code (@segmentCode).

So, before the delivery you can have one split activity, in which you can filter out the recipients who have Segment Code as Empty and send the delivery to only those which have Segment Code value populated.

Level 2
November 25, 2020

I tried to write a typology as well using JS which queries the segment code field. This code works within a workflow, but not within the typology rule. If the segment code isn't populated at all, there is no field to query.. so i added a catch. That being said I cannot seem to query target data from within a typology rule, it just fails everytime. @jonathon_wodnicki any ideas?

 

Here is my typology rule code:

 

try {

    var query= xtk.queryDef.create(

            <queryDef schema={vars.targetSchema} operation="count">

                <select>

                    <node expr="@segmentCode"/>

                </select>

                <where>

                   <condition expr={"@segmentCode = ''"}/>;

                 </where>

            </queryDef>)

           

     if( query.ExecuteQuery().@count > 0 )

        

         {

         

         //Segment code is not populated for all records in the target data. Trigger the typology = return false

         return false;

         }

         else

         {

           //No empty segment codes. Do not trigger typology = return true

           return true;

         }    

        }

        catch(e) {

          //No segment code for any of the records. @segmentCode cannot be queried. Trigger the typology = return false

          return false;

        }

Jonathon_wodnicki
Community Advisor
Community Advisor
November 25, 2020
Change {vars.targetSchema} to "nms:tmpBroadcast". Also add a target mapping for segment code to broadlog if it's not already there.