cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
timalex
Helper I
Helper I

URL Param Iteration Ideas

Okay, so help me figure this one out.

 

I am implementing Cloudflare SaaS WAF Zone for all of my hosted clients (1000 +)

 

We are frontloading all of the DNS and Custom Hostname records into our Cloudflare WAF SaaS Zone so that our clients can update their DNS as they see fit.

 

Problem is, I need to constantly refresh the validation on these custom hostnames so that whenever a client finally gets around to updating their DNS to point at our Cloudflare SaaS WAF zone it passes validation as quickly as possible (i.e. less downtime for client) 

 

I can do this via a PATCH call to Cloudflare, problem is with their API i have to specify a "Page=1" URL variable. So now i have to stupidly create a new flow for each page once that page exceeds 50 rows. (see below).

 

I mean i can keep 'saving as' my flow and then up the Page=2, Page=3, Page=4, etc, but that's not elegant at all. 

 

I also can't count or 'get' the number of pages thru an api call from Cloudflare. 

 

So tell me how do i do this with one flow rather than 20????

 

 

timalex_0-1625217862455.png

 

 

timalex_1-1625217899918.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @timalex ,

you could initialize an array variable with all the page numbers in the format below.

[
 "1",
 "2",
 "3",
 "4",
 "5",
 "6"
]

Add 'Apply to each' to loop through that array and process the number one by one (From = the variable).

Inside the 'Apply to each' place the HTTP request, where you replace the page number with the 'Current item' dynamic content. That way it'll loop through all the numbers and call the http request with the current number used as the page number.

It won't help with the page numbers though, you'll have to add a new number into the array manually when needed.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

1 REPLY 1
tom_riha
Super User
Super User

Hello @timalex ,

you could initialize an array variable with all the page numbers in the format below.

[
 "1",
 "2",
 "3",
 "4",
 "5",
 "6"
]

Add 'Apply to each' to loop through that array and process the number one by one (From = the variable).

Inside the 'Apply to each' place the HTTP request, where you replace the page number with the 'Current item' dynamic content. That way it'll loop through all the numbers and call the http request with the current number used as the page number.

It won't help with the page numbers though, you'll have to add a new number into the array manually when needed.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (3,317)