Hi,
Apologies for the basic question but I've tried a thousand different variants and not come up with the answer myself. Also non of the documentation seems to address this. Getting this to work will close off this particular task I need to complete.
I want to create an instance variable and populate it with a field from my target data. I can successfully create and populate it with hardcoded text as below, however I need to to pull in a data field instead
instance.vars.AKTEST = "Campaign Name"
I want to replace "Campaign Name" with the field @campaignLabel which I have appended in a previous enrichment (please see screenshot).
I had hoped that instance.vars.AKTEST = instance.operation.label would work but this simply returns a null value (if it did work then I would simply use the instance.operation.label variable when I required it later on).
Solved! Go to Solution.
Hi Alistair,
You can do so by using queryDef API on the temporary schema created for Enrichment activity. Please follow the steps outlined below from the test I carried out. You can make changes as per your workflow.
Adding the code here for reference.
var query = xtk.queryDef.create( <queryDef schema="temp:enrich" operation="select"> <select> <node expr="@newFirstName"/> </select> </queryDef>); var resultSet = query.ExecuteQuery(); for each (var row in resultSet) { logInfo("From temp schema : " + row.@newFirstName); instance.vars.AKTEST = row.@newFirstName; logInfo("From instance variable : " + instance.vars.AKTEST); }
When my sample workflow is executed, the output is
Hope this helps.
Regards,
Vipul
Hi Alistair,
You can do so by using queryDef API on the temporary schema created for Enrichment activity. Please follow the steps outlined below from the test I carried out. You can make changes as per your workflow.
Adding the code here for reference.
var query = xtk.queryDef.create( <queryDef schema="temp:enrich" operation="select"> <select> <node expr="@newFirstName"/> </select> </queryDef>); var resultSet = query.ExecuteQuery(); for each (var row in resultSet) { logInfo("From temp schema : " + row.@newFirstName); instance.vars.AKTEST = row.@newFirstName; logInfo("From instance variable : " + instance.vars.AKTEST); }
When my sample workflow is executed, the output is
Hope this helps.
Regards,
Vipul
That works perfectly.
Doing this I am able to populate my extract file name with this variable and am also able to pass it through to my template subject line from my delivery by using 'delivery.label = instance.vars.AKTEST' in the delivery modification script and then using <%= message.delivery.label %> in the subject line in the template.
Thank you so much for your help!
Hi,
COuld you please let me know how to pass delivery label in the subject line?
<%= message.delivery.label %> in the subject line in the template- not working for me and passing exactly the same text in the subject line.
'delivery.label = instance.vars.AKTEST' in the delivery modification script---This worked for me.
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies