I’m running a loop, I have to keep auth code in the loop so I have a code note that has “||” statement, it doesn’t appear to be working at all.
I have very similar || config running in bunch of other workflows.
What is the error message (if any)?
ERROR: Cannot read properties of undefined (reading ‘authorization’) [line 4]
Why do you need the authorization in the count node? You can refer to the auth header in the GetDevices node by using the absolute link: $('getJWT').last().json.headers.authorization.
but that won’t work as on the next loop there is no more headers property, so the code node won’t be able to get to the OR statement. Next is that you want to get the authorization from the count node, but it doesn’t have such property
That one will work:
Plus, your page++ node looks into $('GetDevices').item.json.response.page so here the response should be the Object, but in the umfurl node we can see that the response is Array: _input.all()[0].json.response[0].devices, so the page++ won’t work and you will get every time the 1st page