Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
JFryk
Contributor
Contributor

How to use tExtract JSON without a loop

This seems like a simple fix but as you can see from the screens shots I've looked at this several ways and cannot determine how to extract a non-looping value in tExtractJSON.

I have a job that calls an API and needs to get the link for the next call.

Set up is:

{

  "value": [

         all chat related attributes that needs to imported

         ],

  "odatlink": link

}

I have pulled the link and am attempting to extract the JSON. tExtract will not allow me to get the single non looping value that can be found in the JSON Evaluator or in the case when I use a test file and set the tFileInput to a single loop.

Is there a way to extract a JSON value without a loop?

Thank you in advance!

Labels (3)
2 Replies
Anonymous
Not applicable

Hi

Set the root node as loop element, for example:

 

assuming the returned string from API looks like below:

{

 "odatlink": "http://localhost:8080"

}

Set the root node as loop Set the Loop Jsonpath query as: "$", the Json query expression as: "odatlink", you should be able to extract the link value using tExtractJsonFields component.

 

Regards

Shong

 

 

jeoste
Creator
Creator

Hello,

I recommend you to use jsonpath.com. YOu put your JSON with the solution provided by shong and you can see the content you'll be extracting from this json