Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Rfoot
Contributor III
Contributor III

Talend trest Post with body

Hi,

 

This is our second week using talend as an organisation after training, so we are very fresh.

I am currently sending a body in trest to retrieve a token. 

This is my setup

Rfoot_1-1715632700537.png

 

This is my tmap. The response is a string and not json for some unknown reason so textractjson didn't work.

Rfoot_2-1715632731130.png

 

I get that token successfully in this format. 

Rfoot_3-1715632841241.png

How does one put that string value into a variable? 

 

Regards,

Ryan

 

Labels (3)
1 Solution

Accepted Solutions
Shicong_Hong
Support
Support

Hi

You can assign the string value to a variable on a tJavaRow component. eg:

tRest--main--tJavaRow

on tJavaRow:

context.varName=input_row.Body;

//context.varName is a context variable defined in the Context view.

Regards

Shicong

 

View solution in original post

3 Replies
Shicong_Hong
Support
Support

Hi

You can assign the string value to a variable on a tJavaRow component. eg:

tRest--main--tJavaRow

on tJavaRow:

context.varName=input_row.Body;

//context.varName is a context variable defined in the Context view.

Regards

Shicong

 

Rfoot
Contributor III
Contributor III
Author

Hi Shicong_Hong,

 

Thank you for the reply.

I have given this a go and I believe it worked.

 

My twarn has the message: "Context varName = " + context.varName

This is the output.

Rfoot_0-1716149372464.png

 

So, thank you very much for the help. Much Appreciated.

Ryan

 

Shicong_Hong
Support
Support

Glad to be of help. Thanks for your feedback!

Regards

Shicong