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

SOLVED

Setting a control cell using javascript

chrisr17787094
Level 2
Level 2

Hi there

I have recently started using javascript within a delivery to dynamically set certain fields and prevent the need for duplicating email templates (eg delivery.label = "Label for segment 1";)

I now have a desire to set options for a control cell in this way too, and was wondering if this was possible?

1 Accepted Solution
Marcel_Szimonisz
Correct answer by
Community Advisor
Community Advisor

Hello Chris,

1. set you template as you like

2. Edit -> Edit XML source

1484569_pastedImage_0.png

Find what you are looking for and set it in JS

In your case:

<delivery ....>

<execution broadEndDate="" broadStartDate="" maxRetry="5" nextPassDate="" passStartDate=""

             retry="0" retryPeriod="3600">

    <controlGroup activeOrder="0" enabled="true" fixed="10" percentage="10" schema="nms:recipient"

                  type="1">

      <where filteringSchema=""/>

      <humanConfig>Random sampling with size limited to 10 %</humanConfig>

    </controlGroup>

  </execution>

....

</deliver>

In JS of delivery activity set control group:

delivery.execution.controlGroup.type = 1;

delivery.execution.controlGroup.percentage= 50;

delivery.execution.controlGroup.fixed= 10;

delivery.execution.controlGroup.schema="nms:recipient";

In workflow

1484597_pastedImage_5.png

result:

50% control gruop

1484598_pastedImage_6.png

Marcel

View solution in original post

0 Replies
florentlb
Level 10
Level 10

Hi Chris,

I'm not sure of what you mean by "control cell". Can you give more details?

Florent

florentlb
Level 10
Level 10

Hello,

Any update on this issue?

Florent

chrisr17787094
Level 2
Level 2

Hi there

I'm referring to when you set a control group within a delivery:

1484562_pastedImage_0.png

Marcel_Szimonisz
Correct answer by
Community Advisor
Community Advisor

Hello Chris,

1. set you template as you like

2. Edit -> Edit XML source

1484569_pastedImage_0.png

Find what you are looking for and set it in JS

In your case:

<delivery ....>

<execution broadEndDate="" broadStartDate="" maxRetry="5" nextPassDate="" passStartDate=""

             retry="0" retryPeriod="3600">

    <controlGroup activeOrder="0" enabled="true" fixed="10" percentage="10" schema="nms:recipient"

                  type="1">

      <where filteringSchema=""/>

      <humanConfig>Random sampling with size limited to 10 %</humanConfig>

    </controlGroup>

  </execution>

....

</deliver>

In JS of delivery activity set control group:

delivery.execution.controlGroup.type = 1;

delivery.execution.controlGroup.percentage= 50;

delivery.execution.controlGroup.fixed= 10;

delivery.execution.controlGroup.schema="nms:recipient";

In workflow

1484597_pastedImage_5.png

result:

50% control gruop

1484598_pastedImage_6.png

Marcel

View solution in original post

chrisr17787094
Level 2
Level 2

Thanks Marcel that's really helpful, for this problem and for other problems too.