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

Avatar

Avatar
Validate 1
Level 2
Prasanna_Soni
Level 2

Like

1 like

Total Posts

67 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Affirm 1
View profile

Avatar
Validate 1
Level 2
Prasanna_Soni
Level 2

Like

1 like

Total Posts

67 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Affirm 1
View profile
Prasanna_Soni
Level 2

24-04-2021

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 3
Level 3
Amit_Shinde
Level 3

Likes

22 likes

Total Posts

17 posts

Correct reply

11 solutions
Top badges earned
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Boost 3
Level 3
Amit_Shinde
Level 3

Likes

22 likes

Total Posts

17 posts

Correct reply

11 solutions
Top badges earned
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile
Amit_Shinde
Level 3

25-04-2021

Hi @Prasanna_Soni,

 

Please use the below condition.

 

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

 

Thanks,

Amit

Answers (0)