Hello !
I would like to create a workflow for reporting purposes, that would automatically use data relative to the last sent deliveries as an input to formulate queries and collect some data (tracking logs for example).
I'm able to generate the query to obtain those deliveries, and I added an enrichment with the delivery code. I would now like to create javascript variables using the values in the "Delivery code" column.
How could I proceed to create and use those variables ?
Regards,
Ombeline
Solved! Go to Solution.
Views
Replies
Total Likes
So I've used a simple query which I'm sure you can change as per your requirement
Then I'm fetching the delivery code in Enrichment.
If you then see the schema of outbound transition it can be reached via schema temp:enrich. Please check in your case as well.
The add a JS code activity use the following code
var query = xtk.queryDef.create(
<queryDef schema="temp:enrich" operation="select">
<select>
<node expr="@deliveryCode"/>
</select>
</queryDef>);
var results = query.ExecuteQuery();
for each (var result in results) {
logInfo(result.@deliveryCode);
}
I'm looping through the code to print them in the logs but you can modify the code to use in your setup.
Regards,
Vipul
Views
Replies
Total Likes
So I've used a simple query which I'm sure you can change as per your requirement
Then I'm fetching the delivery code in Enrichment.
If you then see the schema of outbound transition it can be reached via schema temp:enrich. Please check in your case as well.
The add a JS code activity use the following code
var query = xtk.queryDef.create(
<queryDef schema="temp:enrich" operation="select">
<select>
<node expr="@deliveryCode"/>
</select>
</queryDef>);
var results = query.ExecuteQuery();
for each (var result in results) {
logInfo(result.@deliveryCode);
}
I'm looping through the code to print them in the logs but you can modify the code to use in your setup.
Regards,
Vipul
Views
Replies
Total Likes
Thank you very much for your help Vipul !
I have used your code (just changing the variable name to resultsCrdrn). I just would like to know how to access the variable created in this query:
The idea would be to use Crdrn as a list, with the different delivery codes, so that I can select everyone who has been targeted with a delivery which is in the variable resultsCrdrn.
Could you please explain how to proceed ?
Thanks again,
Ombeline
Views
Replies
Total Likes