Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys, Can anyone guide me on the below requirement.
I have a better understanding of GET & DELETE methods and struck with PUT. I have to update two attributes(fields) in my client console.
I have a spreadsheet with four columns, ID, Name, Name2 & Name3. The requirement was to update Name3 & Name4 for each IDs. I will pass ID in the URL to update records (https://aaa/bbb/cccc/2.0/dddd/ffff/1010), and I have done this before. For PUT method, we required to pass HTTP Body in tRest. And it's mandatory to include ID & Name here, since those are unique matches to update Name3 & Name4. (pl see below JSON)
{
"name": "Test1",
"id": "1010",
"name3": "test123",
"name4": "test456"
}
Please guide me to achieve this by providing components and flow?
Thanks in Advance!!
KarthI
The tRestClient component is better suited for this as it has more features than tRest. You would construct the JSON body however you want before the tRestClient, e.g. with a tWriteJSONFields or tJavaRow component. Declare a String schema variable called 'string' that contains the body. tRestClient will read the body from here. Select the 'PUT' method in the tRestClient and fill out any other variables you need. You can use variables in the URL and relative path fields in tRestClient so you can dynamically build your REST URL with the ID, for example. Set the content type to JSON.
See here for the full documentation on tRestClient.
https://help.talend.com/reader/hCrOzogIwKfuR3mPf~LydA/~V42EBQClKxKQghNvzHF1g
The tRestClient component is better suited for this as it has more features than tRest. You would construct the JSON body however you want before the tRestClient, e.g. with a tWriteJSONFields or tJavaRow component. Declare a String schema variable called 'string' that contains the body. tRestClient will read the body from here. Select the 'PUT' method in the tRestClient and fill out any other variables you need. You can use variables in the URL and relative path fields in tRestClient so you can dynamically build your REST URL with the ID, for example. Set the content type to JSON.
See here for the full documentation on tRestClient.
https://help.talend.com/reader/hCrOzogIwKfuR3mPf~LydA/~V42EBQClKxKQghNvzHF1g
Thanks, dude. Its worked but still, I am facing runtime error. I have googled a bit and found may be a chance of missing Environment variables(JAVA PATH) in my machine, but files(jdk & jre) advanced versions exist.
Attached the screenshot for reference. Please advice.
Did you move your project around or put it in a new folder? That looks like Talend cannot find the project at the location where you are trying to run it.
My Project inside the workspace, but still it's showing the error.
You could try building the project again or restarting Studio.
Hi, The above issue has been fixed. But now we are facing the issue in tRESTClinet, can you please help us to fix the below.
Error Detail: