Hi,
I'd like to loop a request that polls an API a set amount of times, with having to create the nodes for each loop.
Currently everything works correctly just that if I want to add an additional page of results I have to copy+paste the nodes, which after 75 pages worth of API pulls my flow is quite large!
The first request is to
"https://www.website.com/?orderBy=_info/lastUpdated desc&pagesize=1000&page=1"
and the next one would be for example
"https://www.website.com/?orderBy=_info/lastUpdated desc&pagesize=1000&page=2"
[{"id":"94cd81fb54165be1","type":"inject","z":"cf5f51c0ab747382","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"headers","v":"{\"clientid\":\"dfedb32c-0995-45ce-9fa2-835c7a3d98a0\",\"Content-Type\":\"application/json\"}","vt":"json"}],"repeat":"","crontab":"50 23 * * 0","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":250,"y":200,"wires":[["ad99126195072689","468652dfc704b451"]]},{"id":"ad99126195072689","type":"delay","z":"cf5f51c0ab747382","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":240,"y":240,"wires":[["5a1a1eb5e2cd2d6a","658e7b633b95fa01"]]},{"id":"5a1a1eb5e2cd2d6a","type":"delay","z":"cf5f51c0ab747382","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":240,"y":280,"wires":[["5968c09367d877f8"]]},{"id":"468652dfc704b451","type":"function","z":"cf5f51c0ab747382","name":"","func":"msg.url = \"https://www.website.com/?orderBy=_info/lastUpdated desc&pagesize=1000&page=1\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":200,"wires":[["ed1585cf1dea324b"]]},{"id":"658e7b633b95fa01","type":"function","z":"cf5f51c0ab747382","name":"","func":"msg.url = \"https://www.website.com/?orderBy=_info/lastUpdated desc&pagesize=1000&page=2\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":240,"wires":[["d899fde25fe99796"]]},{"id":"5968c09367d877f8","type":"function","z":"cf5f51c0ab747382","name":"","func":"msg.url = \"https://www.website.com/?orderBy=_info/lastUpdated desc&pagesize=1000&page=3\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":280,"wires":[["602c8e3fb3410b31"]]},{"id":"ed1585cf1dea324b","type":"http request","z":"cf5f51c0ab747382","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":630,"y":200,"wires":[[]]},{"id":"d899fde25fe99796","type":"http request","z":"cf5f51c0ab747382","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":630,"y":240,"wires":[[]]},{"id":"602c8e3fb3410b31","type":"http request","z":"cf5f51c0ab747382","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":630,"y":280,"wires":[[]]}]
Is there an elegant way to do this a set amount of times?