Hi everyone. I understand that for an array of items I can simply do the following to extract the item I want
return [items[2]]
However if the item contains keys, and I want to extract for example the 1st key, how would I go about doing this? Is there a similarly simple solution?
Thanks! I’m sharing an example workflow that might help
The first Function node simply mocks the data that you provided. The next Function node contains code where I am referencing the values.
If you always want to return the value for event_type, the snippet for the first variable will be helpful.
If you want to return always the first item (it can be anything, not necessary to be event_type), the code snippets for the variable first_item and first_key_value will be useful.