Exclude customers based on delivery they are going to get | Community
Skip to main content
Level 4
Nov 2, 2022 9:12 AM UTC
Solved

Exclude customers based on delivery they are going to get

Hello,

I have a tricky question. I have a target group that will get an email and this email has a certain delivery code. I would like to exclude customers based on that delivery code of the delivery they are going to get without hard-coding it in a split.

 

For example:

Recipient logs doesn't exist such as delivery code = "delivery code of the delivery at the end of the wkf"

 

Is it possible to do it with a JS code or maybe through typology rules?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Shubham_Goyal__
Shubham_Goyal__Accepted solution
Level 6
Nov 11, 2022 4:31 AM UTC

Hi @a_b_se ,

 

I have a simple suggestion for you, why not try using queryDef on the temp table and then exclude the data with the WHERE clause?

For this you can do the following steps:

1. Declare a column that says @exclude  in additional data (like Query, enrichment) before the Js.

2. Create a Js activity and do queryDef on the incoming temp table with WHERE:

var del = xtk.queryDef.create(
<queryDef schema="temp:<your temp table name>" operation="select" lineCount="1000000">
<select>
<node expr="@id"/>
<etc>
<etc etc .. what feilds you need>
  <where> <condition expr="@nature NOT LIKE %VÄLKOMNA%"/> </where>
</queryDef>
).ExecuteQuery();

3. For these outputs of recipients Id's (rows) you can update this new "@exclude" field with 'Yes' or 'No' using the WRITE function in for each loop.

4. Next you can now add a 'Split' or 'Test' activity and remove the recipients with the field @exclude as 'Yes' or 'No'.

 

Steps 1 & 3 are explained in more detail in one of my answers in past: link

 

Br,

Shubham

7 replies

Shubham_Goyal__
Shubham_Goyal__Accepted solution
Level 6
Nov 11, 2022 4:31 AM UTC

Hi @a_b_se ,

 

I have a simple suggestion for you, why not try using queryDef on the temp table and then exclude the data with the WHERE clause?

For this you can do the following steps:

1. Declare a column that says @exclude  in additional data (like Query, enrichment) before the Js.

2. Create a Js activity and do queryDef on the incoming temp table with WHERE:

var del = xtk.queryDef.create(
<queryDef schema="temp:<your temp table name>" operation="select" lineCount="1000000">
<select>
<node expr="@id"/>
<etc>
<etc etc .. what feilds you need>
  <where> <condition expr="@nature NOT LIKE %VÄLKOMNA%"/> </where>
</queryDef>
).ExecuteQuery();

3. For these outputs of recipients Id's (rows) you can update this new "@exclude" field with 'Yes' or 'No' using the WRITE function in for each loop.

4. Next you can now add a 'Split' or 'Test' activity and remove the recipients with the field @exclude as 'Yes' or 'No'.

 

Steps 1 & 3 are explained in more detail in one of my answers in past: link

 

Br,

Shubham

Translate
Sukrity_Wadhwa
Employee
Nov 17, 2022 6:35 AM UTC

Hi @a_b_se, 

Were you able to try @shubham_goyal__'s proposed solution? Let us know if it helped you resolve your issue or if you need more help with your query.

Thanks!

Translate
Sukrity Wadhwa
A_B_SEAuthor
Level 4
Nov 10, 2022 11:56 AM UTC

Any other suggestion?

Translate
ParthaSarathy
New Participant
Nov 2, 2022 2:22 PM UTC

Hi @a_b_se ,

In the delivery activity > script create the below instance variable

instance.vars.myDeliveryCode = delivery.deliveryCode;

 

In split activity, you can call this delivery code as $(instance/vars/@myDeliveryCode)

 

 

Translate
 ~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
A_B_SEAuthor
Level 4
Nov 3, 2022 8:34 AM UTC

Thank you, I tried but it doesn't seem to work. I'm trying to filter on DelCode_5_Syfte:

 

My test customers delivery logs has deliveries with DelCode_5_Syfte = VÄLKOMNA:

When i hard-code the value it works as usual:

When trying apply your rule:

Do you know why it doesn't work for me?

 

 

 

 

Translate
ParthaSarathy
New Participant
Nov 3, 2022 10:10 AM UTC

@a_b_se , Are you using this split in the downstream transition of the delivery (After delivery)?

Translate
 ~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups