Hello everyone,
Does anybody know how to declare a variable on Adobe from a list ?
I have a list with 4 columns and I want to create a variable for each cells of the list : that means for each line there will be 4 variables (the final aim is to put the variables in a delivery ). I think I should use a Javascript but I don't know what to put inside...
Furthermore I have another question, I don't find in documentation if global variables exist. I mean a variable created in a workflow (A) that can be used/modified by the workflow (B) even if the WF (A) is not running.
Thanks for your help,
Regards,
Valentin
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Valentin,
For the List variables, best will be to use an array.
From the schema tab of query activity you can get the schema name, probably it will be temp:query
You can then use this code
var query = xtk.queryDef.create(
<queryDef schema="temp:query" operation="select">
<select>
<node expr="@use"/>
<node expr="@label"/>
<node expr="@[D_1]"/>
<node expr="@[D_2]"/>
<node expr="@[D_3]"/>
<node expr="@[D_4]"/>
<node expr="@[D_5]"/>
</select>
</queryDef>);
var results = query.ExecuteQuery();
var data= [];
for each (var result in results) {
data[0] = result.@use;
data[0] = result.@label;
data[0] = result.@[D_1];
data[0] = result.@[D_2];
data[0] = result.@[D_3];
data[0] = result.@[D_4];
data[0] = result.@[D_5];
}
Views
Replies
Total Likes
Hi Valentin,
The term global variables is called as Options in Campaign.
If you are on ACC, you can set an option on one workflow calling setOption Javascript function and then on the other workflow use a getOption function.
Views
Replies
Total Likes
I'm not very clear of your first use case. Can you please elaborate more?
Views
Replies
Total Likes
Hi Vipul,
Thanks for your answer and your help. Do you have an example of script for the first case ? I want to store in a variable the number of sets in a workflow using vars.recCount. I don't know exactly how to use the function setOption with recCount.
For your second answer and my first point, I'll illustrate step by step what I want to do. So I would like to create as many variables as possible from a list read.
I mean I want to create 7 variables in this case (for each "cells").
Do you have any idea about how I can do that ?
Thanks for your time.
Regards,
Valentin
Views
Replies
Total Likes
Hi Valentin,
For the List variables, best will be to use an array.
From the schema tab of query activity you can get the schema name, probably it will be temp:query
You can then use this code
var query = xtk.queryDef.create(
<queryDef schema="temp:query" operation="select">
<select>
<node expr="@use"/>
<node expr="@label"/>
<node expr="@[D_1]"/>
<node expr="@[D_2]"/>
<node expr="@[D_3]"/>
<node expr="@[D_4]"/>
<node expr="@[D_5]"/>
</select>
</queryDef>);
var results = query.ExecuteQuery();
var data= [];
for each (var result in results) {
data[0] = result.@use;
data[0] = result.@label;
data[0] = result.@[D_1];
data[0] = result.@[D_2];
data[0] = result.@[D_3];
data[0] = result.@[D_4];
data[0] = result.@[D_5];
}
Views
Replies
Total Likes
Hello Vipul,
Thanks a lot for your help and your time.
I succeeded to use the global variables with setoption and getOption and I'm now tackling the issue on the list.
Regards,
Valentin
Views
Replies
Total Likes