Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Dynamically update an HTML address with a loop.

ISUGraber
8 - Asteroid

Hello everyone,

I have been working on several different methods on trying to connect to an API and download some data.  The method i have found that is currently working and I want to explore to see how big of an issue this could be is to use HTTP addresses.

 

So i have an HTTP address that will return a JSON.  Say it's http://ThisAnnoyingAPI.com/UserID = 'bbb'  

 

I have a list of UserId's that I want to get the data from the API with and in this API's infinite wisdom I have to query each user id on it's own.  

 

So i have 2 questions.   First is how can i dynamically update my HTTP address and replace it with the next user ID that I want to run the HTTP script with.  

Then with that is the 2nd question, what is the best way to loop this?  So my goal is I have an HTTP Address, it runs the first ID, then loops, runs the second, grabbing all of the JSON files, when it's done it parses all of the JSON's together.  

 

I have attached my workflow that successfully grabs one userID that I hardcode into the HTTPs line.

1 REPLY 1
DavidP
17 - Castor
17 - Castor

You can create a text input field with the API url and feed to it a download tool. You then convert this to a batch macro that updates the value of the userid via a control parameter like this

 

url batch.png

 

You then create a workflow that contains your list of userid's which is fed to the batch macro's control parameter. When you run the workflow, the macro will be executed for each value in the list

 

url batch workflow.png

 

See workflow and macro attached

Labels