I have a Rest API with pagination. I get the output as XML. I am parsing l. And the data might increase every 2 weeks. So I don'w know how many pages it may grow or reduce. Each page will have only 50 records. I am using Iterative Macro to implement pagination. I have set my iterations to 50. Currently, after 30 page iterations there is no data. So the XML parse is failing since there is no new records of XML to parse. how do I break the loop if there is no data. Currently i set the iterations to 50. That way even if it increases it could pull all the data.
Solved! Go to Solution.
You probably want your XML parsing after the filter tool that specifies the iteration criteria. That way if the value is null it will exit out rather than trying to always parse the XML regardless of its existence.
I have a download tool followed by XML Parse tool. The output of Download tool give me an XML and outer XML. Then I am parsing the Outer XML. It says "Record_OuterXML" is not contained in the record.
You could take a placeholder approach like this where you union Record_OuterXML followed by a !IsNull([Record_OuterXML])
That way there will always be a column even if the Outer XML is not returned. I'm not sure what you are ultimately passing out as data, but hopefully this points you in the right direction.
When the XML is parsed I would get new columns. IF I just put the placeholder the columns that are generated after the parsing will still be missing and it will fail.
I realized that I can check on row count. Add filter to check number of rows is equal to 50 then pass the next iteration values otherwise it will stop the iteration. if the values for next iteration are empty.
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
6 |