Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I use tWriteJsonField to send it into the body of an API.
The problem is that one of the field needed for the API is a number:
How can I do it?
Thanks
So finally I manage to create a simple String in a T_Java to make my Json inside an array []. As it was impossible with tWriteJsonField which always start by
{"root", [...data...]}.
And it works 🙂
Sometimes the easiest way is the best^^
Oh and not in the body but in the string of the API. And activating the "Log messages" option in Advanced settings in the tRESTClient is VERY helpfull.
Thanks gJeremy for your time and your help 🙂
HI, here a workaround , you can name your attribute with non special char then after change it with the one you want with a tReplace component for example.
Send me love and kudos
Thanks, but I don't see how tReplace can change the name of the column when it only change the value?
if your output is a type String, you can replace all you want in with a tReplace so you can name your attribute with a really specific Name like @attributeToChange for example and then looking for this and replace it with is real name here 1473
I seriously don't see what I'm supposed to do to change the column name and not the value 😕
If the output of your tWriteJsonField have a field of type String wich contain your Json, you can use a tReplace on it, so you'll overwrite all you want in the json, before sending it to the api.
tWriteJsonField -->tReplace--> tRestClient
I tried: tWriteJsonField -->tReplace--> tRestClient
With:
output column of my tWriteJson
inside tReplace:
The result is still the same in the log:
{"rootTag":{"data":{"@id":"5960","attributes":{"element":{"@idContext":"0","@idLanguage":"1","@value":"1880"}}}}}
It does not change the element name by 1473.
uncheck wole word checkbox in the tReplace will do the job
I'm still getting a 400 bad request.
It does not change if I send with tWriteJson or a simple string that looks like a Json. The tRestClient don't take it, in the string or the body.
I use Patch/Json/json.
Perfectly working on postman but nothing in the studio 😕
Thanks for your time and answers.
have you tried to do it via postman before try it into talend ?