How to pass a reference to variable in Update query | Community
Skip to main content
Level 2
February 1, 2023
Solved

How to pass a reference to variable in Update query

  • February 1, 2023
  • 1 reply
  • 2182 views

Hi,

 

I have to insert/update data to Campaign classic DB from a JS activity. I receive the info in a webservice call, so i read the date and loop and have to pass the details in an update query. But the query is only accepting values not a reference to variable which I read from the call. please advice how an I pass a reference to var?

 

I have the below script,

 

workEmail is the variable with value I read from the webservice call data.

 

var updateEmp = <recipient xtkschema="nms:recipient"
operation="_update" _key="@email"

email= workEmail
futRetNot="true" />

xtk.session.Write(updateEmp);

 

I get this error,

 

 js JST-310000 Error while compiling script 'tWKF945/js' line 79: invalid XML attribute value (line=' email= workEmail' token='workEmail').

 

How can I pass the workEmail?

 

Thanks,

Sirisha

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by _Manoj_Kumar_

Hello @sirikambampati 

 

You can pass it like this.

email= {workEmail}

 

1 reply

_Manoj_Kumar_
Community Advisor
_Manoj_Kumar_Community AdvisorAccepted solution
Community Advisor
February 1, 2023

Hello @sirikambampati 

 

You can pass it like this.

email= {workEmail}

 

     Manoj     Find me on LinkedIn
Level 2
February 2, 2023

Hi @_manoj_kumar_ 

 

In my Campaign instance, I have recipient folder in two different locations,

1) under Profiles & Targets

2) Customized for us, under Business Units.

 

When I try to insert data it is writing into the schema under Profiles & Targets, which is 1) location. But we want it to be inserted in the 2) location.

 

Do I have to include a folder_id in the insert xml query?

Please advice.

 

Thanks!

 

How can I insert data in the different location, do I have to mention folder _id in the insert?

 

Level 2
February 2, 2023

@sirikambampati Yes, No need to mention the folder id in the key


@_manoj_kumar_ Thank you, much appreciated.

 

I am actually reading the data from a webservice call and have to send notification/delivery email to the email id which dynamically comes from the API.

 

How can I pass this into a delivery which I have to send through the JS activity.?

 

I have a template for delivery with content, I have to use that template to send a delivery with the email_id which comes from the webservice call and also first and last name??