Extracting Column Names out of Json Path

I have multiple Json paths Nodes, which all operate on different Json objects, I would like to always use the name of the 1st output column in this example “col_name” (they change) and use it in a String Manipulation Node afterwards, is there any of passing this name as a variable out of the Json Path Node / Table

Thanks!

The best way I can think of right off the top of my head would be to use the “extract column headers” node from the output, then use the table row to variable from those headers to have a list of all your column names as variables.

Hi there @tbtt,

you can create flow variables from configuration options under Flow Variables tab. Just add text (which will be new variable name when node successfully executed) into blank text box next to configuration you are interested in. See example:

JPFlowVariable

In your case you will have all new column names in one array flow variable. Then use following approach to have only first column as string flow variable:

ArrayFVManip

Br,
Ivan

2 Likes

Thanks, this was exactly what I was looking for!
I thought about reducing the amount of nodes a little bit and replace your 3 nodes with something like a Java Edit Variable or a Variable Expressions, however the “newcolName” Variable only appears in the Variable to Table Row node. I dont really get why, can you tell me why?

1 Like

Hi there @tbtt,

glad it helped!

Regarding flow variables type array - that is new flow variable type and still not available in each node. However there is a ticket to enable it in nodes you mentioned (both Java Edit Variable and Variable Expressions) so I will give them +1 for you :wink:

Br,
Ivan

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.