Alteryx Designer Desktop Discussions

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

Iterative Macro or Batch Macro

wengao
5 - Atom

Hello Alteryx Professionals,

 

I am new to Alteryx Macro, so I am not quite sure how to deal with my situation now. Hope you could help.

 

So the purpose of this Macro, is to get all the history changes from Smartsheet for a specific column. However, smartsheet only has an API that we can fetch cell history, so if I want to fetch for a specific column, I need to kind of loop every row to get each cell's history. There are 2 steps that I need to do:

1. Use sheet id and Column name to fetch the specific column related rows info, ie, row id. (By calling smartsheet API)

2. Then use the column id and row id to locate each cell, and fetch the cell history changes by calling another smartsheet API.

 

So if there are 5 rows in total, I will need to use step 1 for once to get the column id, and the 5 row ids, and then use step2 for 5 times to fetch all the cells history, then union together to be a column's history change.

 

In this case, I need a macro, that could partially loop itself, by using step 1's output as the input. And the real input for this whole Macro should be an sheet id, and a column name to locate which column I want the history changes. Then I am not sure how to do this, and if it is iterative or Batch macro that I should use.

 

Thank you in advance!

3 REPLIES 3
NickSm
Alteryx
Alteryx

Hi @wengao,

 

Sounds like you are speaking of a batch macro, where (for example) your first API call retrieves the column ID and 5 row IDs, and your second API call is inside the batch macro. Since you would like to run this API macro once for each Row ID, you would want to use the Row ID field as your control parameter (the value by which the macro determines how to split each batch). If you have 5 values for Row IDs, the macro would run 5 times, once for each ID.

 

Hopefully this Batch Macro How-To post is helpful, with the control parameter being the most important piece:

 

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Getting-Started-with-Batch-Macros/t...

 

Probably worth noting that you can actually pass the Download tool a list of URLs and header/payload values in a single table, and it will execute those multiple calls in series - meaning that you may not actually need to turn this into a batch macro. You would just want to make use of dynamically updating your headers/payload via fields in your table, as shown in the below configuration:

 

DownloadToolConfig.PNG

 

wengao
5 - Atom

Thank you for ur help! Yes you are right, I can just use a standard macro on this one. I was stucked by my thinking of how to loop things. It helps a lot! Thanks!

brwright
8 - Asteroid

Hi @wengao , where can I get more instructions about this: 

You can actually pass the Download tool a list of URLs and header/payload values in a single table, and it will execute those multiple calls in series - meaning that you may not actually need to turn this into a batch macro. You would just want to make use of dynamically updating your headers/payload via fields in your table, as shown in the below configuration:

Labels