Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Using data from list box for control parameter in batch macro

Lichunhuang
7 - Meteor

 

Hi I am trying to use a list box to get the data and configure them to a formula used for batch macro. 

If I select multiple countries from the list  box, it takes multiple steps to generate string: Contains([ADMIN],"Andorra") or Contains([ADMIN],"Austria")

This will be used for control parameter.

It runs well within the batch macro, however, I got empty sheet when it ran in the workflow.

List Box

Lichunhuang_0-1655130275253.png

Workflow: Highlight part will generate the formula: Contains([ADMIN],"Andorra") or Contains([ADMIN],"Austria")

Lichunhuang_3-1655130758721.png

 

 

 

Batch Macro

Lichunhuang_2-1655130698717.png

Batch macro configuration:

Lichunhuang_0-1655131535761.png

 

 

Output wanted: Admin column only contains the countries selected from list box.

 

Lichunhuang_4-1655131346458.png

 

2 REPLIES 2
DanM
Alteryx Community Team
Alteryx Community Team

@Lichunhuang 

 

It seems to me based on the screenshots that you don't need to generate a formula, but just update the variables within the Formula with in the macro.

 

A much simpler solution is to use the list box app and connect it to a text input tool and parse out the data using the text to column tool and using the split to rows selection. That will then create the list of selections. That stream would then be fed into the macro where it would update a contains statement. Your also missing action tools with the app and the macro. This is an important tool to be able to update other tools when using apps and macros.

 

In the macro, if you use the Action tool between the app and the filter tool, the action tool will allow you to update specific aspects of the filter tool and not have to feed it an entire expression. Also with the app the action tool will allow you to setup a text input tool to be able to easily parse out the data and create your true list from the users selection to feed into the macro.

 

I would highly recommend reviewing this information on macros and apps. 

 

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-Action/ta-p/35500

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-Check-Box/ta-p/60724

https://community.alteryx.com/t5/Interactive-Lessons/Using-List-Boxes/ta-p/243116

https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Macros

 

 

Lichunhuang
7 - Meteor

Thank you! That works for me! I appreciate your help!

Labels