Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi im doing a simple loop which should increment the pages in a url and give me a resultant output concatenating the results of the loop.
if I change the page number 1 at a time I can see that there is a value for each page.
when I run the loop I can see it increments through the 10 pages, however the result is just 1 line for 1 page.
loop below:
for i=0 to 10
LET $(vPage) =$(i);
summaryTable:
LOAD total_rows,
index,
PageNumber,
summaryKey
FROM [http://test.test-api.com/testing/api/sometable.php?appid=testappid&token=someToken&page=$(vPage)]
(XmlSimple, Table is [sometable/summary]);
Next ;
am i doing something obviously wrong here?, any pointers will be welcome
Ah right sorry, change
LET $(vPage) =$(i);
to LET vPage = $(i);
and give that a try, by expanding the variable like that, it's like you are saying
Let 1 = x
and not actually changing your vPage variable and looping the same page 10 times
Joe
looks fine, and as you say is iterating through the 10 pages. When you hardcoded in page1 did you return more than a single row?
Joe
if I hard code page 1 I get 1 row with the page number showing page 1 and so on for the other pages.
the loop only returns the last page its almost like it does not append to the first 1-9 pages..
Ah right sorry, change
LET $(vPage) =$(i);
to LET vPage = $(i);
and give that a try, by expanding the variable like that, it's like you are saying
Let 1 = x
and not actually changing your vPage variable and looping the same page 10 times
Joe
Joe Simmons
Spot on. I overlooked that
No worries let me know if that resolves the issue when you re-run
That works perfect.
perfect, can you mark and close this one down then if possible, cheers