Extracting element from arrays

Hello everybody,

i am trying to understand how these array works. In “make” there was a node for it so it was a bit easier. The ultimate goal is to get the selected Tasktype and transfer it to airtable.

Scenario:
I have different Task Types in Clickup. If i choose one of the them, a customfield named Task Type is filled with these Tasktypes.
In this example its “Area Design” but the output is still Blockout.

But i think i have hardcoded only the index of 2. (Blockout). Area Design is on the 4th. How can i iterate threw a array, extract it and make a right condition to transfer into airtable. İt
Any Idea?

My Wrong Code

{{ $json.custom_fields[2].type_config.options[2].label }}



Hey @Cetryn hope all is well,

to be honest, it is not clear what you are trying to do, let’s try to get to the bottom of it. Could you re-ask the question in the framework of “I have”, “I want”, “I tried”, “But I got”. Explain the data you have, paste the text of that data, so that the person looking into can get into solving your problem right away instead of trying to come up with the repro. Example would be: “I have the following JSON structure: []”. Then explain what you want to get, for example "I wish to get the value of every field named X from the JSON>. Then show how you are trying to solve your problem, and finally - what you get instead of your desired result. Having a good and properly formulated question is very important not only to those who are trying to answer it, but in some cases even for the one who is asking. I often even end up solving my own question while asking it. Please try to share your problem again and let’s see if we can sort it out.

Pointing to fixed index might not be a good idea.

You can try this one with find

{{ $json.custom_fields[2].type_config.options.find(opt => opt.label === "Area Design")?.label }}

If will go through the array and find the lable you need.

In short, you can use the Loop node like in this Pseudo example