We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Pass date parameters into API to iterate for the whole year.

swadson
7 - Meteor

Hi,

 

I am working on a flow where I am constructing a POST API call by initially requesting for a Bearer token and then passing that into another API call along with date to get data. Unfortunately the API is timing out if I pass the start date's for the entire year. I might have to reduce the timeframe to monthly or quarterly intervals and make multiple api calls to get all the data for the year. I am new to iterative macros and need help configuring the macro if that is the approach to be taken. Below is the screen show where the start and end dates are hard coded into the body. How can is set a macro to cycle through the dates?

 

 

Below is the screenshot where I am constructing the body and passing into the API payload.

 
 

 

API1.PNG

 

API2.PNG

 

How do I loop through the start and end dates in monthly intervals for the year 2022?

5 REPLIES 5
BS_THE_ANALYST
15 - Aurora
15 - Aurora

Would it be okay to use generate rows here? @swadson 

Screenshot 2023-07-20 134708.png

All the best,
BS

LinkedIN

Bulien
BS_THE_ANALYST
15 - Aurora
15 - Aurora

Workflow here

All the best,
BS

LinkedIN

Bulien
BS_THE_ANALYST
15 - Aurora
15 - Aurora

Just spotted you wanted to iterate over the months. That's cool. We can use a batch macro to perform that iteration. You'll likely need to put the download tool within the macro to pass the requests through per iteration (for each month).

Screenshot 2023-07-20 135746.png

 

All the best,
BS

LinkedIN

Bulien
swadson
7 - Meteor

@BS_THE_ANALYST Thank you for the solution. I am not following it how the generated numbers would iterate around. Would it iterate around the month numbers?

 

. Here is what I am looking for 

 

on the first API call would have the following start and end dates, that could be passed into the body.

StartDate: 02/14/2023

EndDate: 03/14/2023

 

The flow should iterate to make the second API call with the below date

StartDate: 03/15/2023

EndDate:04/14/2023

 

and so on..

 

Eventually we would need to combine all the date data from these API's into one data sent.

 

swadson
7 - Meteor

@BS_THE_ANALYST - Here is something that I started working on using the batch macro example. Would something like this work?

Labels
Top Solution Authors