Hi,
I want to access adminSystem parameter in workflow using javaScript code. From value of adminsytem I want to split the templates.
Thank you in advance.
Best regards,
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @RiyaMa
Could you please log the variables res and result to see the structure.
If I am understanding you structure correctly then, you can access adminSystems by :-
var a = res.data;
var b=a.adminSystems.
Regards
Akshay
Views
Replies
Total Likes
Hello @RiyaMa
I am assuming you are working with webApp.
The code to get adminSystem is
ctx.vars.adminSystem
Views
Replies
Total Likes
Thanks @_Manoj_Kumar_ I am very new to Adobe Campaign basically have workflow where In JavaScript code I have added below code
var schemaName = vars.targetSchema.substring(vars.targetSchema.indexOf(":") + 1);
logInfo(schemaName);
var collection = <{schemaName + '-collection'} xtkschema={vars.targetSchema}/>
//logInfo("Collection" +collection);
var query = xtk.queryDef.create(
<queryDef schema= {vars.targetSchema} operation="select" lineCount={vars.recCount}>
<select>
<node expr="[target/ctx]" alias="data" />
<node expr="@id" />
</select>
</queryDef>
)
var res = query.ExecuteQuery();
var result = res.toXMLString()
I was thinking I will get ctx value from here and then will split templates on basis of ctx value.
Thanks,
Shubhada
Views
Replies
Total Likes
Hi @RiyaMa ,
Can you confirm if the ctx values comes from a query. If so, then you may not need javascript, you can direclty use a split activity to segregate the population based on the query data.
Views
Replies
Total Likes
Not from query, It is coming from api and right now i am triggering from postman.
Views
Replies
Total Likes
Hi @RiyaMa
Could you please log the variables res and result to see the structure.
If I am understanding you structure correctly then, you can access adminSystems by :-
var a = res.data;
var b=a.adminSystems.
Regards
Akshay
Views
Replies
Total Likes
Hi @RiyaMa,
Were you able to resolve this query with the help of the given solutions or do you still need more help here? Do let us know. In case the given solutions were helpful, then kindly choose the one that helped you the most as the 'Correct Reply'.
Thanks!
Views
Replies
Total Likes