REST API Query in Loop responding with Invalid Parameter if I use variables

The Loop and very similar query before it work just fine with the {{}} variable. If I explicitly enter the values for the URL parameters "Course" and "Lesson" then the API responds as expected. If I use the variables {{value[index].course}} and {{value[index].id}} I get a 400 response back that the expected parameter is of type integer, but as far as I can tell it is sending an integer (if I hover over my variables they are of type number and the expected values). I've tried changing the variables to {{parseInt(value[index].course)}} and {{parseInt(value[index].id)}}, but these have the same result.

I don't know what is going on or how to debug.


Would you be able to share the format of the output of your first loop?

The way the two loop nodes back to back will function is not that you are executing the second node for every iteration of the first node but rather it will iterate over the output of the first loop node. I ask about the format of the first loop output because I don't believe you will need {{value[index].course/lesson}} but rather just {{value.course/lesson}} since those (I assume) are going to be the properties of each item in the first loop's output.

I can't post the full array, but the format is JSON like: "[[{"id":93991,"date":"2020-11-02T23:57:09",...". Which is unfortunately why I must use index as the first loop outputs 3 values and each has around 6 indices. Would this impact the API call? Like I said, hovering over the variable shows the expected value, so I know the variable is written correctly.

On another note, is there a way to nest loops?

There isn't a nested loop function that I am aware of just yet, but you can insert a JS/Python code block between the two loops to "re-loop" and process/transform the first results to be in a better format for the next loop block.

You can also switch the GUI loop to the Code function and add in the loop there but I've found it easier to debug when I'm making my own arrays in a code block to send cleanly to the restAPI loop.