Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

How to pass parameter into a python script in a batch macro?

calloni
9 - Comet

Hello

 

I am trying to create a batch macro that contains a python script. In the python script there are 2 variables that I want to be dynamic so I don't need to hardcode my APIKEY and APITOKEN on it.

 

I went through the Action tools and tried to Replace a specific string but that didn't work.

 

The workflow is attached. If someone could give me hand, it would be amazing.

 

Thanks

Rodrigo

5 REPLIES 5
afv2688
16 - Nebula
16 - Nebula

Hello @calloni ,

 

Since you are already are passing data into the tool, why not write them into two different fields also?

 

Untitled.png

 

Regards

PhilipMannering
16 - Nebula
16 - Nebula

Hey @calloni.

 

Here's a way I found to update the Python Tool directly.

1. Change the notebook from interactive mode to production mode (this will also make your macro run faster, ~ half the time) 

PhilipMannering_0-1616243681351.png

2. Change your action tools to update productionModeScript -value

3. Specify the string you want to replace.

PhilipMannering_1-1616243818415.png

 

I have attached a working, simplified version.

Spoiler
PhilipMannering_2-1616244112274.png

 

 

calloni
9 - Comet

Amazing solution! Thanks!

calloni
9 - Comet

Thanks very much for the idea too! 

 

Rodrigo

kumaran52v
Alteryx Alumni (Retired)

The above solution isn't working for me. I have modified the workflow slightly as per my needs. Can someone help why it is not working.

Labels