Expresion json in tmap

Four Stars

Expresion json in tmap

Hello,
I would like to send a json expression (in tMap) to a tRest for a PUT message but I have an error:

My expression JSON:

 

"{\"EntityList\": \"[\""+"

"{\"EntityName\": \"lead\","+"\"Id": \""+Var.var1+"\","+"\"Attributes\":\"[\""+"

"{\"Name\" : \"crmvi_opt\","+"\"Type\" : \"integer\","+"\"Value\" : \"0\""+"}""+"

\"]\""+"}""\"]\""+"}"

 


Accepted Solutions
Sixteen Stars

Re: Expresion json in tmap

You are putting quotes around the wrong sections. For example, arrays ([...]) do not need quotes around them. I believe your code should look more like this....

 

"{\"EntityList\": [{\"EntityName\": \"lead\","+"\"Id\": \""+Var.var1+"\","+"\"Attributes\":[{\"Name\" : \"crmvi_opt\",\"Type\" : \"integer\",\"Value\" : \"0\"}]}]}"

All Replies
Sixteen Stars

Re: Expresion json in tmap

You are putting quotes around the wrong sections. For example, arrays ([...]) do not need quotes around them. I believe your code should look more like this....

 

"{\"EntityList\": [{\"EntityName\": \"lead\","+"\"Id\": \""+Var.var1+"\","+"\"Attributes\":[{\"Name\" : \"crmvi_opt\",\"Type\" : \"integer\",\"Value\" : \"0\"}]}]}"