Exclude customers based on delivery they are going to get | Community
Skip to main content
Level 4
November 2, 2022
Solved

Exclude customers based on delivery they are going to get

  • November 2, 2022
  • 3 replies
  • 1752 views

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.
Best answer by Shubham_Goyal__

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

3 replies

ParthaSarathy
Community Advisor
Community Advisor
November 2, 2022

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)

 

 

~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
A_B_SEAuthor
Level 4
November 3, 2022

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?

 

 

 

 

ParthaSarathy
Community Advisor
Community Advisor
November 3, 2022

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

~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
A_B_SEAuthor
Level 4
November 10, 2022

Any other suggestion?

Shubham_Goyal__
Shubham_Goyal__Accepted solution
Level 6
November 11, 2022

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

Sukrity_Wadhwa
Community Manager
Community Manager
November 17, 2022

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!

Sukrity Wadhwa