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: 
JY3
Contributor
Contributor

Can I add context value in eExtractJSONFields or add parent value of Loop Jsonpath query into output?

Hi experts,

The below is JSON file

{

  "id": 895564,

  "idn": "35",

  "dataDocumentCustomFields": {

    "data": [

      {

        "id": 1674099,

        "value": "168177",

      },

      {

        "id": 1674100,

        "value": "168250",

      },

      {

        "id": 1674101,

        "value": "169067",

      }

    ]

  },

  "isBudgetOverLimit": false

}

I want to have output as below

0695b00000deJaEAAU.png

However, because idn is above Loop Jsonpath query, I was not able to enter JSONQuery on tExtractJSONFields. So, I assigned idn into context but still Json query can't read it as below. Could you please advise how I can include the parent value of Loop Jsonpath query into output?

0695b00000deJZzAAM.png

0695b00000deJa4AAE.png

0695b00000deJa9AAE.png

Labels (4)
1 Solution

Accepted Solutions
tnewbie
Creator II
Creator II

ok, here is the complete solution to the problem

0695b00000deTMbAAM.pngStep 1:

I am first fetching the idn value from tExtractJSONField

Step 2:

I am fetch the array elements from data array

0695b00000deTMWAA2.png0695b00000deTKvAAM.pngtExtractJSONFields_1 schema would look like this :

0695b00000deTNAAA2.pngtExtractJSONFields_2 config and schema would look like this

0695b00000deTNUAA2.pngEnd result would like this

0695b00000deTNeAAM.png 

View solution in original post

5 Replies
tnewbie
Creator II
Creator II

You have not shared how and where your context.order is being instantiated.I think the issue is sensibile and is very self explanatory...

 

have your tried this, because you seem to have an array holding id and values, you may have to introduce [] in your json query, if u start getting ur id and value as null from the below approach

0695b00000deSM6AAM.png 

JY3
Contributor
Contributor
Author

Hi @tech seeker​ ,

if I set

0695b00000deSl6AAE.png 

I get

0695b00000deSlBAAU.png 

if I set..

0695b00000deSlGAAU.png 

I get

0695b00000deSlLAAU.png 

if I set.

0695b00000deSlQAAU.png 

I get..

0695b00000deSlVAAU.pngdid I make any mistake?

 

tnewbie
Creator II
Creator II

ok, here is the complete solution to the problem

0695b00000deTMbAAM.pngStep 1:

I am first fetching the idn value from tExtractJSONField

Step 2:

I am fetch the array elements from data array

0695b00000deTMWAA2.png0695b00000deTKvAAM.pngtExtractJSONFields_1 schema would look like this :

0695b00000deTNAAA2.pngtExtractJSONFields_2 config and schema would look like this

0695b00000deTNUAA2.pngEnd result would like this

0695b00000deTNeAAM.png 

JY3
Contributor
Contributor
Author

Yes, it worked. Thank you for your help. you saved me.

tnewbie
Creator II
Creator II

Glad, it worked for you