Undefined set variable inside loop after first item

I’m trying to use a variable that i defined in my SET inside a loop but after the first item it is undefined.

My GetWorkflowById node cant get my set-cookie var from PostLogin node after the first item execution.

There is any keyword like excel($) to fix the reference of the item?

Hi @Andrelfc, welcome to the community!

The problem here will be that your PostLogin node returns 1 item, but your GetWorkflowById node receives multiple items. So, you probably want to use an expression like {{ $("PostLogin").first().json["headers"]["set-cookie"] }} to make sure to always reference the first (and only) item from your PostLogin node.

You might want to check out this post for a slightly longer explanation:

Let me know if you have any questions on this :slight_smile:

1 Like