I need to get the count of variables from the query's property of webhook node

I’m trying with this, but doesn’t work
var length = {{$node[“Webhook”].json[“query”].length}};

This is in the FunctionItem node

I make a change, this show me all variables that i put in url.

return item.root.query

But i can’t show the length of this.
I can’t do for example: item.root.query[0], for extract the first element to this object.

Hey @victormiranda, you can count it with {{Object.keys($json["query"]).length}}.

This workflow would solve your problem:

Hope that helps! :slight_smile:

1 Like

yes thanks you

and for get the property from a position, like Object.keys($json[“query”])[0] ?

Yup, you can get the first key with {{Object.keys($json["query"])[0]}} and the first value with {{Object.values($node["Webhook"].json["query"])[0]}}.

1 Like

Great to hear! Mind marking the post that solved the question? Would be helpful for other community members to discover the solution as well :slight_smile:

Thanks, the workflow is working

1 Like