Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Exclude customers based on delivery they are going to get


Level 2


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?

7 Replies


Level 7

Hi @alberto_bodini ,

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)





Level 2

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?






Level 7

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


Level 2

No I'm using it before delivery since I need to exclude customers based on the delivery they are going to receive.


Level 5

Hi @alberto_bodini ,


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">
<node expr="@id"/>
<etc etc .. what feilds you need>
  <where> <condition expr="@nature NOT LIKE %VÄLKOMNA%"/> </where>

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






Hi @alberto_bodini

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.