Hello I have such a scenario. am I going in the right direction? One of my problems is the endless loop. The reason for this is that I cannot update the cursor value in the loop. If I could, the loop might end.
Hi @Max_T
We cannot really judge the workflow without the requirements.
The loop you have, seems to already have an IF node to stop the loop. I guess this is not working?
Can you share the output of the HTTP request you make? The problem is probably that you do not properly select the field you need to check.
If you post the output of that HTTP request we can give it a look.
Yes, this loop doesnât work as it should. The loop is infinite because I canât pass a cursor value to the beginning of the loop.
The initial value cursor is set before entering the loop. The first time the loop passes, the value of cursor should change, but I canât set this value to something else.
[
{
âentriesâ: [
{
â.tagâ: âfileâ,
ânameâ: âPolonez.jpgâ,
âpath_lowerâ: â/szotestowe/polonez.jpgâ,
âpath_displayâ: â/SZOtestowe/Polonez.jpgâ,
âparent_shared_folder_idâ: â2870338481â,
âidâ: âid: gdsfgdsgdsfgâ,
âclient_modifiedâ: â2022-08-23T09: 56: 30Zâ,
âserver_modifiedâ: â2022-08-23T13: 58: 41Zâ,
ârevâ: âtertet54e543wt4ertâ,
âsizeâ: 348660,
âsharing_infoâ: {
âread_onlyâ: false,
âparent_shared_folder_idâ: â346543645654â,
âmodified_byâ: âdbid: gdsfgresdt54t4e543534e5435â
},
âis_downloadableâ: true,
âcontent_hashâ: â4356etrtgsdfgg454t54tgretret54t554ty657657y453532rrrewtretert5467567yrttgfdsgfâ
}
],
âcursorâ: âRTYRTY54654657Y5TRYUTRYTRYTRY54RTYERYTREYTRETY-TETETERTERTERTER_CyOQXNhx8LybqMhZUdaa5gTMcU8Te1gVyMEPdTdklivbs0xNrtvc4GcWJgWH-k4k-qAqIXSRbWwGzZoU7j-mNSIqexfdgI_X1t6fzzKjz38w78Ydn8rTHZC5AA7afOjiLV1dQZXrp_6pQ8iW4I0TtomYjDCGtLFt8WDWzLNtDITTYNUwxrDBkCdM547rRZgbwsRdhQofOigOAK1GDY0RvdOAkN0CaaGHrLL_JIS6CKdnVvQE4-OhKmumsv1VCQâ,
âhas_moreâ: true
}
]
Cursor is an item in a dropbox. If has_more = true there are more files and the loop starts all over again. However, I can not update the cursor variable, which causes the loop to read files from the same position and the loop cannot end.
Ah sorry I misread then.
Do you know the next cursor? Does the HTTP request also return that?
yes, the http module before the loop gets the first cursor, the http module in the loop gets the new cursor. My problem is I donât know how to replace it.
loop is infinite because it uses the same cursor all the time. In the sense of the same cursor value
Thank you very much :), and how to pass the cursor value from http?
you can use a set node at the end of your loop to retrieve that new cursor from the HTTP node.
How do I get a value from http and want to insert it into the function item code, am I then using the set item? In this code below I put something wrong, how should it be correct?
const defaultCursor = $ node [âFirst filesâ]. json [âcursorâ];
if (item.cursorReturned) {
item.cursor = item.cursorReturned;
}
else {
item.cursor = defaultCursor;
}
console.log (âDone!â);
return item;
For this to work properly, I need to copy the value into the variable created by function itmes. How to do it ?
Just use the set node thatâs a lot easier.
I do not have time to look at it for you.
ok, i understand a little, but now i have a bug. explain to me that the variable is of the wrong type. do I understand this error correctly?
do I understand this error correctly?
You need to simply do item.cursor if you want to retrieve the value in the field cursor that is coming into the node.
Thank you, Iâve already dealt with it.