Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

Persisting Information in Alteryx w/o having to constantly reference a file

Archaeopteryx
10 - Fireball

Hi,

Most of my Alteryx projects involve APIs. Go out, get an OAuth Token, make API call and do work.

 

Much of the APIs require a batch macro where I feed in information to API, get results, call API, get results, and so on...

 

I want to make the request for an OAuth once and use that same Bearer Token throughout the lifecycle of the workflow. So, I'm making the OAuth request, saving that token to a file, then I enter the batch macro where thousands of API calls are made, and each time, the Authorization token is required read in from the document where it was initially saved. 

 

PROBLEM:

Rather than reference the saved Authorization token from a document, it is possible to save it to memory and reference it from memory for each API call? I know it's reading the document each time because the log file indicates such. 

 

Thanks for any assistance,

Chris

2 REPLIES 2
jrgo
14 - Magnetar

Hi @Archaeopteryx 

 

Yes and you'd achieve this by submitting the initial request to get the token outside/before your batch macro. Once obtained, feed that into one of your Macro Input tools (not the Batch Control Parameter) and you'll have that token to use on each batch loop.

 

A little different setup if using an iterative macro, but same idea... just need to make sure the token is included in the macro output tool that's set as your iterative output.

Archaeopteryx
10 - Fireball

Jrgo

Thank you. I moved the document reference outside the macro and used the macro input tool to introduce the value. 

 

Chris