tExtractJSONFields question - unable extract JSON field

One Star

tExtractJSONFields question - unable extract JSON field

Hey guys - I'm trying to get an authorization token via rest basic authentication. The rest request seems to work okay, but I'm not able to extract the authorization token from the response. Here's what the response looks like:
"expires in":"1235"
I'm using the tExtractJSONFields to try and extract the "access_token" parameter. See attached screenshot of what I'm doing

Here's how I have the tExtractJSONFields configured:

and here's what how the schema is set:

Unfortunately, the output of the component is null.
Any suggestions would be appreciated.

Re: tExtractJSONFields question - unable extract JSON field

We can't see the screenshot on our side. Could you please check it? Make sure your screenshot is not bigger than 2MB.

Best regards
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: tExtractJSONFields question - unable extract JSON field

Thank you for the response. The preview of the post showed that the screenshots loaded successfully - not sure what happened.
I decided to try and use a tJava component to parse it myself. I believe the error is (and this is a fundamental misunderstanding of how Talend works on my end) is that, the tRest component sends the request and the rest of the subjob triggers BEFORE the response is received. So, effectively a NULL value is passed to the rest of the subjob. appears. Not sure how to pass the actual response from tREST to the rest of the subjob... Would it be a wait step or something else?
Better understanding this issue would really help in a lot of ares in using Talend...
So, here's a very simplified example of what I'm doing.
tRest sends request. tJava triggers at the same time. if the simple code in tJava_1 is
NULL is printed.
I'm sure this is rudimentary stuff - I really appreciate your help.


Talend named a Leader.

Get your copy


Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables


Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables


Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema