Skip to main content
tejashriw155148
Level 4
Dec 5, 2019 1:52 PM UTC
Solved

Update data using Update Data activity and Javascript code

Hi,

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

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:

But email field from recipient is not getting updated.

Please let me know what should I do here.

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Jyoti_Yadav
Jyoti_YadavAccepted solution
Level 8
Dec 6, 2019 5:12 AM UTC

Hi,

If you have defined variable in javascript as:

vars.email=" ";

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

$(vars/@email)

Thanks.

2 replies

Jonathon_wodnicki
Community Advisor
Community Advisor
Dec 5, 2019 5:14 PM UTC

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

Translate
Jyoti_Yadav
Jyoti_YadavAccepted solution
Level 8
Dec 6, 2019 5:12 AM UTC

Hi,

If you have defined variable in javascript as:

vars.email=" ";

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

$(vars/@email)

Thanks.

Translate