Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

Avatar
Validate 1
Level 1
Prasanna_Soni
Level 1

Likes

0 likes

Total Posts

62 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Ignite 1
Give Back
Affirm 1
View profile

Avatar
Validate 1
Level 1
Prasanna_Soni
Level 1

Likes

0 likes

Total Posts

62 posts

Correct Reply

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

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 2
Amit_Shinde
Level 2

Likes

11 likes

Total Posts

17 posts

Correct Reply

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

Avatar
Boost 3
Level 2
Amit_Shinde
Level 2

Likes

11 likes

Total Posts

17 posts

Correct Reply

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

25-04-2021

Hi @Prasanna_Soni,

 

Please use the below condition.

 

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

 

Thanks,

Amit

Answers (0)