JSONPATH how to get group names

Hello,

I hope everyone is staying safe and healthy.

I have an issue that I couldn’t find a work around. I hope the community can help me.

This is the return from a GET API (it is a very long list)

I am using JSON PATH and (try to) get field name, alias and the type

The table that I am trying to create;
alias | fieldname | type
First Name | firstname | text
Last Name | lastname | text
Profession | f1601 | drop

I wasn’t able to bring field names to the table. Can someone help me with this challange?

Thanks in advance.

Nezir

Hi,
what exactly is the problem? What output do you get? My guess is that you have to add a [*] to the fieldname path.
Kind regards
Alexander

1 Like

Hi Alexander,

Currently I can’t get the names from the “fields”. This is what it brings when I use $…[‘fields’]
image

It selects the whole. But I just need the names of the fields only, like “firstname”, “lastname”, “f1601”

When I try your suggestion, it becomes like this
image

I’ll need the other way around :slight_smile:

Thanks,
Nezir

Hi,
can you share the JSON so I can try it out myself and maybe provide you with a solution?
Kind regards
Alexander

Sure. I am adding here.
JSONBody.txt (171.3 KB)

Thanks in advance,
Nezir

Hi,
please have a look at the workflow I attached. I extract the path and then use a String Manipulation node to get only the field name.

alias: $.data.*.fields.*['alias']
type: $.data.*.fields.*['type']
fieldname: $.data.*.fields.* (with "Paths" ticked)

Kind regards
Alexander

json.knwf (9.7 KB)

4 Likes

This is brilliant!!

Thank you so much for the help.

Kind regards,
Nezir

2 Likes

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