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
Community Manager

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
Community Manager

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\"}]}]}"

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch