Fetching and storing data in variables in Web Applications
Hi Team,
I have created a web application that redirects to anyone of the 4 landing pages based on certain criteria (OfferAcceptedPage, OfferExpiryPage, OfferDeclinePage, ErrorPage). There are 3 parameters (ParamKey1, ParamKey2, ParamLanguage) passed in the URL. I have also created 5 variables to hold the values for Key1, Key2, Language, Response and OfferExpiryDate.
I am fetching the required values using the below queryDef:
var res = xtk.queryDef.create(
<queryDef schema="nms:recipient" operation="select">
<select>
<node expr="[Table1/Key1]"/>
<node expr="[Table1/Key2]"/>
<node expr="[Table1/Language]"/>
<node expr="[Table1/OfferExpiryDate]"/>
<node expr="[Table2/Response]"/>
</select>
<where>
<condition expr={"[Table1/Key1]='"+ctx.var.ParamKey1+"' and [Table1/Key2]= '"+ctx.var.ParamKey2+"' and [Table1/Language] = '"+ctx.var.ParamLanguage+"'"}/>
</where>
</queryDef>).ExecuteQuery();
for each (var rcp in res)
{
ctx.vars.Key1 = rcp.Key1;
ctx.vars.Key2 = rcp.Key2;
ctx.vars.Language = rcp.Language;
ctx.vars.OfferDate = rcp.OfferExpiryDate;
ctx.vars.Response = rcp.Response;
}
Issue: In this case, I am able to see the values for ctx.vars.Key1, ctx.vars.Key2 and ctx.vars.Language (in the Preview tab debug mode). But the values for ctx.vars.OfferDate and ctx.vars.Response appear blank in the Web application. I have checked the table and it has values populated for both the fields. I have also tried testing the above queryDef in a JavaScript activity in a workflow, and I am able to view the values for ctx.vars.OfferDate and ctx.vars.Response.
Query:
1. Can anyone please help me understand the reason for this behavior?
2. Is there any other way to fetch data for columns stored in linked tables within Web Application?
Thank you in advance.
Kind Regards,
Anushka R