Skip to main content
Prasanna_Soni
Level 4
Apr 25, 2021 1:44 AM UTC
Solved

How do we access the variable from Previous page5 activity in to script ?

I am trying to accept the email as text input field and once i accept that need to verify if record exists in recipient. if exists , then get id and preload the webapp with that id. if email does not exisits then give url without id. 

 

So i created MEmail as variable in page text inlut activity, and accepting the email. Now in next activity i defined Script and in code i am calling that variable 

<condition expr="@email=ctx.vars.@MEmail"/> , but its not executing. Seems I am calling wrong way that variable ? any help ? 

 

var query = xtk.queryDef.create(
<queryDef schema="nms:recipient" operation="getIfExists">
<select>
<node expr="@email"/>
<node expr="@id"/>
</select>
<where>
<condition expr="@email=ctx.vars.@MEmail"/>
</where>
</queryDef>
)


var res = query.ExecuteQuery()

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Amit_ShindeAccepted solution
Level 3
Apr 25, 2021 8:26 AM UTC

Hi @prasanna_soni,

 

Please use the below condition.

 

<condition expr={"@email='"+ctx.vars.MEmail+"'"}/>

 

Thanks,

Amit

1 reply

Amit_ShindeAccepted solution
Level 3
Apr 25, 2021 8:26 AM UTC

Hi @prasanna_soni,

 

Please use the below condition.

 

<condition expr={"@email='"+ctx.vars.MEmail+"'"}/>

 

Thanks,

Amit

Translate