Skip to main content
Solved

How to get lists of data from a Json Call?


Marcel-Jan
Star Blazer L2
Forum|alt.badge.img+1

For a near future project we want to get capability data on terms. We have a graphQL query to get this data (the hardcoded gid is just for experimentation sake. It will be parameterized of course):

query GetCapabilities_term {   term(gid:  "5877cd9a-0000-7000-0000-000000b63f13") {     gid     assignedIdentities {       capability {         name         id         operationSets {           name           displayName           id         }       }       identity {         ... on Role {           name           ... on GroupRole {             name             gid           }         }       }     }   } }

 

I've created this very simple component to explore working with this data.

 

 Here is the Json Call:

And the data stream in the Json Call:

It runs the graphQL query and gets the results. In the Json Call debug with response data I can see the call was successful and we have data.But it will get multiple results for multiple capabilities. This Json Call just writes the last line of the list to the output file. 

 

Is there a way to write the whole list to the output file?

 

Best answer by AKislyakov

Hi @Marcel-Jan,

Number of rows in the output is determined by number of nodes fetched by the Path expression ($.data in your case). To get distinct rows for every capability you need to create a child Data Stream with the Path assignedIdentities.capability. Same goes with operationSets, you need to create yet another child stream to fetch every operationSet. In general your hierarchy of Data Streams should reflect hierarchy of JSON nodes. Good news is that you can include attributes from parent streams via Shadow columns section.
 

 

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+2
  • Ataccamer
  • 149 replies
  • Answer
  • March 3, 2024

Hi @Marcel-Jan,

Number of rows in the output is determined by number of nodes fetched by the Path expression ($.data in your case). To get distinct rows for every capability you need to create a child Data Stream with the Path assignedIdentities.capability. Same goes with operationSets, you need to create yet another child stream to fetch every operationSet. In general your hierarchy of Data Streams should reflect hierarchy of JSON nodes. Good news is that you can include attributes from parent streams via Shadow columns section.
 

 


Marcel-Jan
Star Blazer L2
Forum|alt.badge.img+1
  • Author
  • Star Blazer L2
  • 21 replies
  • March 6, 2024

Hi @AKislyakov 

I've tried this out. I now understand how it works. (And why you would want to have data streams within data streams).

Thanks for explaining!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings