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

SOLVED

Update data using Update Data activity and Javascript code

tejashriw155148
Level 4
Level 4

Hi,

How to update schema using update data activity where input for update data activity should be result of javascript code?

updateData_Query.PNG

In the above workflow, I have created an expression emailAddress = "" and in the JS code sets the value for emailAddress.

Used newly created field in update data activity as below:

updateData_Query1.PNG

But email field from recipient is not getting updated.

Please let me know what should I do here.

Thanks.

1 Accepted Solution
Jyoti_Y
Correct answer by
Community Advisor
Community Advisor

Hi,

If you have defined variable in javascript as:

vars.email=" ";

Then, you have use this variable in update activity as:

$(vars/@email)

Thanks.

View solution in original post

2 Replies
wodnicki
Community Advisor
Community Advisor

Hi,

For vars.varname in js, source field is $(vars/@varname).

You can also cast as needed, $string(vars/@varname) and so on.

If you want rows to have different emails, alter the target table in the js and use that.

Thanks,

-Jon

Jyoti_Y
Correct answer by
Community Advisor
Community Advisor

Hi,

If you have defined variable in javascript as:

vars.email=" ";

Then, you have use this variable in update activity as:

$(vars/@email)

Thanks.

View solution in original post