Free Trial

Alteryx Designer Desktop Discussions

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

Help with Iterative Macro/Batch Macro for Paginated API Calls in Alteryx (Schoox LMS)

sschavan
6 - Meteoroid

Hello all,

I'm working with the Schoox API (Schoox API Docs) to pull data from our LMS, and I'm running into a challenge with pagination. Here’s what I’m trying to do:

  1. Get Learning Paths: First, I make an API call to retrieve a list of all Learning Paths, which gives me their IDs. Here’s the API for that:
    https://api.schoox.com/v1/dashboard/curriculums?role=employee&apikey=9d3419535b0c8d76f7f6f72800f62f9...
    (API Docs: Learning Paths)

  2. Get Enrolled Users for Each Learning Path: For each Learning Path ID, I need to make a second API call to fetch all users enrolled in that Learning Path. Here’s the API for that:
    https://api.schoox.com/v1/dashboard/curriculums/{id}?role=employee&apikey=9d3419535b0c8d76f7f6f72800...
    (API Docs: Enrolled Users)

The Challenge:

  • The second API call (which retrieves users) only returns 1000 users at a time. I need to retrieve all users for each Learning Path, which means I need to implement pagination.
  • The pagination is handled by incrementing a start parameter for each set of 1000 users.

Issue with Iterative Macro:

  • I tried using an Iterative Macro in Alteryx to handle pagination, but since the API requires two dynamic inputs (Learning Path ID and the start parameter for pagination), I’m struggling to make it iterate correctly. The macro only processes one iteration and then stops, without pulling all the data.

I’m new to macros in Alteryx, so I’m unsure how to correctly structure this. Could someone guide me on how to set up the iterative macro to loop through the start parameter until all users are retrieved for each Learning Path? Do I need to use a Batch macro instead - if yes how will the logic work?

Any help would be appreciated!

Thanks!

 

3 REPLIES 3
shancmiralles
11 - Bolide
ChrisTX
16 - Nebula
16 - Nebula

You may need a batch macro that calls an iterative macro.

 

Batch by Learning Path ID, then each batch will iterate to get all of the students/users.

 

Guessing that the students from the Learning Paths API is the same as the "number of users", to tell you how many times you'll need to iterate (students/1000) = number of iterations?

 

Macros are just about the most difficult thing to learn in Alteryx.  The user interface doesn't make it easy to understand, test, or debug macros.

 

A few suggestions to learn:  search for Batch and Iterative here:

  • Community > Learn > Academy > Videos
  • Community > Learn > Academy > Challenges & Quests > Weekly Challenges

 

Also try: workflow configuration option (checkbox) for "Show All Macro Messages"

 

See: Debugging Alteryx Analytic Apps

https://www.altertricks.com/how-to/debugging-alteryx-analytic-apps/

 

These two options are helpful to debug macros:

 

1) Designer > View > Interface Designer > Test View (the magic wand icon on the left hand side) > input your values > Open Debug.
This will create a new standard workflow with the actual values coming from your inputs.
A copy of the workflow will open called Debug Workflow# (# being some number)
You can use the Debug mode to test what values are passed from the app interface to the workflow
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Random-results-while-renaming-fields/t...

 

2) Community > Blogs > Engine Works Blog > The X-Ray Browse: Macro Debugging Made Easier
Designed primarily for developing & debugging macros, the X-Ray Browse enables you to pick a location within a macro under development, to view the data passing through said macro at said location. The effect is similar to a Browse tool, but the data is made viewable through the encapsulating "skin" of the macro being developed.

https://community.alteryx.com/t5/Engine-Works-Blog/The-X-Ray-Browse-Macro-Debugging-Made-Easier/ba-p...

 

Chris

sschavan
6 - Meteoroid

Thank you everyone for responding! I was able to get this done using Python tool!

Labels
Top Solution Authors