Child array variable

I am trying to take the output from json “slug” however after “data” that is “ETH” is dynamic,

{{$node[“HTTP Request”].json[“data”][“ETH”][“slug”]}} when I use this code, and user inputs BTC fore example, the “ETH” is fixed does not change. how could I fix that? thanks!

You would then also replace ETH with a variable. Lets assume the data is in $node["HTTP Request"].json["userInput"] it would look like this:

{{ $node["HTTP Request"].json["data"][$node["HTTP Request"].json["userInput"]]["slug"] }} 

Understood it, what about if the json changes ETH to something else by it’self, how could I request to use whatever comes after [“data”][“new variableGOEShere”][“slug”]

thank you in advance,btw this tool is mind-blowing,I’ve been learning so much.

What if I could just specify that i want to use whatever comes after since it keeps changing[”data”][usethis][“slug”]

If there is only one key something like that should theoretically work:

{{ $node["HTTP Request"].json["data"][Object.keys($node["HTTP Request"].json["data"])[0]]["slug"] }}

Brilliant ! love it. thank you much !

You are welcome! Have fun!

1 Like