Skip to main content
Solved

Looping in a URL


ingalla
Contributor
Forum|alt.badge.img+10

Hi All

 

I have a URL in the format http://blah.com/images/{index] where the maximum index value will be the total number of records minus 1. So for three images the indexes would be 0, 1, 2

What is the best way to take the attribute imagecount and loop to the URL for the correct number of times starting at zero???

 

Just getting a bit confused now....

Regards

 

Best answer by ebygomm

If you know the image count before the call, you can clone to that number (3), this will then assign a copy number (0,1,2) to each feature and you can use that attribute to formulate the url and then send three requests that way rather than looping.

 

I'd only use looping where a value from the previous call was required for the next call

View original
Did this help you find an answer to your question?

3 replies

david_r
Celebrity
  • January 19, 2023

This is often referred to as "pagination" and you can find a pretty good tutorial here:

https://community.safe.com/s/article/Getting-Started-with-API-Pagination

 


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • Best Answer
  • January 19, 2023

If you know the image count before the call, you can clone to that number (3), this will then assign a copy number (0,1,2) to each feature and you can use that attribute to formulate the url and then send three requests that way rather than looping.

 

I'd only use looping where a value from the previous call was required for the next call


ingalla
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • January 20, 2023
ebygomm wrote:

If you know the image count before the call, you can clone to that number (3), this will then assign a copy number (0,1,2) to each feature and you can use that attribute to formulate the url and then send three requests that way rather than looping.

 

I'd only use looping where a value from the previous call was required for the next call

Thanks very much, that worked fine....all this time with FME and still learning!!!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings