There are many implementations in which we have to set the delivery variables based on the vale that we compute in the previous activities in a workflow.
Adobe Campaign has a solution for this type of implementation too
Implementation:
Our use case is that we have to develop a workflow that will send a reminder to our customer. This reminder mail will have their voucher details and also the expiry date of the voucher. The workflow will compute the voucher details and its expiry date. The delivery will use these workflow variables and personalize the email accordingly.
Lets start with the implementation.
Step 1: Create the variables in the delivery template.
The Order in which you declare your variables matters. Here, coucherExpiry is defined in the second position. It will be later used in the workflow as variables[1], and
Now, you can access these variables while personalizing the delivery.
Step 2: Set the variable value in the workflow
Go to your workflow and open the delivery activity. Click on the script tab and set the variables using the below script.
delivery.variables._var[0].stringValue = vars.voucherType
delivery.variables._var[1].stringValue = vars.voucherExpiry
Here, you can use delivery.variables._var[0] to set the value of the variables you defined before.
So, this is how you implement the solution for our use case..
Hope this helps.