Expand my Community achievements bar.

SOLVED

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

Avatar

Level 4

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()

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hi @Prasanna_Soni,

 

Please use the below condition.

 

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

 

Thanks,

Amit

View solution in original post

1 Reply

Avatar

Correct answer by
Level 3

Hi @Prasanna_Soni,

 

Please use the below condition.

 

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

 

Thanks,

Amit