Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Iterative Macro with API pagination

brwright
8 - Asteroid

Hello, I have an API that I pass a limit and an offset.The first pass I have a constructed URL string that starts at offset=0

The first pass returns a JSON Value for a property called "nextPageLink" which already has the next offset.

 

From my workflow, I get an authorization bearer token and pass that to the macro call.

 

Inside the macro, the first tool I have is a formula that sets the initial URL value. 

 

I am getting the results and splitting everything except the "nextPageLink" to the output. I send "nextPageLink" to the Loop. 

 

On iteration 1, it works fine. On Iteration 2 I am getting error:  RPSMacro (63) Iteration #2: Tool #31: The field schema for the output "Loop" changed between iterations.

I am so stuck my eyes are crossed. 

brwright_0-1658775484204.png

 

12 REPLIES 12
gabrielvilella
14 - Magnetar

Nice!

brwright
8 - Asteroid

I just studied my results and they are duplicates of the first call. It's not feeding the nextURL. I've opened a support ticket. I dont understand how the output contains a value and somewhere upstream should grab that value and pass it it through the iteration.  

jrobiso2
8 - Asteroid

You need 2 inputs. One is the URL, and the other is the AUTH.  Separate them, because it has to be designated as the Iterative Input.  Your Iterative macro will need the URL input to be designated as the Iterative INPUT, and the i output designated as iterative output.  Now the fun part - you'll need to parse the metadata from the download to find the nextLevel value, and that goes to your iterative output.

In the overall macro config, settings section, is where you tell it which input/outputs are the iterative ones.

Labels