Hi Team,
Actually there is dynamic web app for the subscription ill be creating to So that i supposed to pass the value in the ending of the web app URL
For Eg:https://sandbox.adobe-campaign.com/webApp/APP400?jurisdiction=SWUSL
So based on the value i ll be doing the condition in query def and fetch the data to display in the web app
Now i want to pass the SWUSL (jurisdiction value or what ever the jurisdiction value is passing through web app URL) to the context variable and i can make condition.
Can anyone help on this?
Feel free to do the follow up for the clarification.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @VV7,
If I understood correctly you can follow the below steps.
var jurisdiction = ctx.vars.jurisdiction;
logInfo("Jurisdiction value: " + jurisdiction);
if the parameter is not automatically mapped, you can manually parse the URL parameter
var jurisdiction = getUrlParameter('jurisdiction'); // Custom function to extract URL parameter
ctx.vars.jurisdiction = jurisdiction; // Store in context variable
Note: The getUrlParameter function is not built-in, so you may need to implement it or rely on Adobe Campaign’s parameter mapping.
Use the Context Variable in QueryDef:
In a Query activity, use the context variable in the queryDef to filter data based on the jurisdiction value. For example:
<queryDef schema="nms:recipient" operation="select">
<select>
<node expr="@email"/>
<node expr="@firstName"/>
</select>
<where>
<condition expr={"[recipient/@jurisdiction] = '" + ctx.vars.jurisdiction + "'"}/>
</where>
</queryDef>
This query filters recipients where the jurisdiction field matches the value from the URL (e.g., SWUSL).
Start → Script (set ctx.vars.jurisdiction from URL) → Query (use ctx.vars.jurisdiction in queryDef) → Page (display results) → End.
https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/push-parameter-val...
Thanks
Sushant Trimukhe
Hi @VV7,
If I understood correctly you can follow the below steps.
var jurisdiction = ctx.vars.jurisdiction;
logInfo("Jurisdiction value: " + jurisdiction);
if the parameter is not automatically mapped, you can manually parse the URL parameter
var jurisdiction = getUrlParameter('jurisdiction'); // Custom function to extract URL parameter
ctx.vars.jurisdiction = jurisdiction; // Store in context variable
Note: The getUrlParameter function is not built-in, so you may need to implement it or rely on Adobe Campaign’s parameter mapping.
Use the Context Variable in QueryDef:
In a Query activity, use the context variable in the queryDef to filter data based on the jurisdiction value. For example:
<queryDef schema="nms:recipient" operation="select">
<select>
<node expr="@email"/>
<node expr="@firstName"/>
</select>
<where>
<condition expr={"[recipient/@jurisdiction] = '" + ctx.vars.jurisdiction + "'"}/>
</where>
</queryDef>
This query filters recipients where the jurisdiction field matches the value from the URL (e.g., SWUSL).
Start → Script (set ctx.vars.jurisdiction from URL) → Query (use ctx.vars.jurisdiction in queryDef) → Page (display results) → End.
https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/push-parameter-val...
Thanks
Sushant Trimukhe
Hi @SushantTrimukheD ,
Actually this one worked well for me
var jurisdiction = getUrlParameter('jurisdiction'); // Custom function to extract URL parameter
ctx.vars.jurisdiction = jurisdiction; // Store in context variable
And as this getUrlParameter not a default function i have defined it explicitly and its worked
Thanks for it.
Views
Likes
Replies
Views
Likes
Replies