Hi,
I'm hoping that you can help me again. My question is: how I can insert variable intName instead of 'OP125' inside <where> condition?
My code in JS workflow activity is:
var intName = 'OP125'
var query = xtk.queryDef.create(
<queryDef schema="xtk:workflow" operation="get">
<select>
<node expr="@label"/>
<node expr="@internalName"/>
</select>
<where>
<condition expr="[operation/@internalName] = 'OP125'"/>
</where>
</queryDef>)
var res = query.ExecuteQuery()
logInfo("///// My Label: " + res.@label)
Could you please help me with this issue?
Thank you,
Marcin
Solved! Go to Solution.
Views
Replies
Total Likes
Hey Marcin,
Sorry I've forgot to include the brackets
<condition expr={"@internalName = '"+intName+"'"}/>
also
If you use the following loop you can get an idea of the object keys available to you.
In the objects value, try also; task, task.workflow
Shall give you something like
so by doing logInfo(instance.label); It gives me the workflow title (screenshot https://db.tt/c1JVowRuhd )
Try playing around with these objects, not sure how to get the campaign name, because i am testing it on a normal workflow.
Views
Replies
Total Likes
<condition expr="[operation/@internalName] = '"+intName+"'"/>
That is (') singlequote, then (") doublequote and +variable+
Views
Replies
Total Likes
Thank you for your response. Unfortunately this script returns error:
Will you be so kind and give me some clues why?
BTW Do you know how to insert value into var intName dynamically? I mean, how to insert current campaign's internal name there?
Thanks,
Marcin
Views
Replies
Total Likes
Hey Marcin,
Sorry I've forgot to include the brackets
<condition expr={"@internalName = '"+intName+"'"}/>
also
If you use the following loop you can get an idea of the object keys available to you.
In the objects value, try also; task, task.workflow
Shall give you something like
so by doing logInfo(instance.label); It gives me the workflow title (screenshot https://db.tt/c1JVowRuhd )
Try playing around with these objects, not sure how to get the campaign name, because i am testing it on a normal workflow.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies