Hi, i Just want to create automation script for A/B testing. Please let me what should i do to make it work as expected?
Thanks in advance.
1. Target population with query or file then split 20% - A and 20% - B
2.Based on the highest open, the winner delivery should be duplicated automatically and should be executed via script
3.But the issue is, the delivery is getting created in audit delivery. It is not visible or the customers are not getting targeted or deployed nor logs are created in the dashboard.
Here's is my workflow with Deliveries from Audit tab:


Here's my script:
//Query delivery schema to find out largest value based on instance and workflow id
var myWin = xtk.queryDef.create(
<queryDef schema="nms:delivery" operation="get">
<select>
<node expr="@id"/>
<node expr="@label"/>
<node expr="[@operation-id]"/>
<node expr="[@workflow-id]"/>
</select>
<where>
<condition expr={"@FCP=0 and [@workflow-id]= " + instance.id}/>
</where>
<orderBy>
<node expr="[indicators/@estimatedRecipientOpenRatio]" sortDesc="true"/>
</orderBy>
</queryDef>).ExecuteQuery()
//Create new delivery
var myDel = nms.delivery.create()
myDel.Duplicate("nms:delivery|" + myWin.@id)
//Add final, date with the delivery label
myDel.label = myWin.@label + " final" + formatDate(new Date(), "%2D%2M%2Y");
myDel.deliveryCode = myWin.@label + "final" + formatDate(new Date(), "%2D%2M%2Y");
//Link with campaign database
myDel.operation_id = myWin.@["operation-id"]
myDel.workflow_id = myWin.@["workflow-id"]
//Prepare and start
myDel.scheduling.validationMode = "manual"
myDel.scheduling.delayed = 0
// save the myDel in database
myDel.save()
myDel.PrepareAndStart()
// store the new myDel Id in event variables
vars.myDelId = myDel.id