We have extended our Early Bird Tickets for Inspire 2023! Discounted pricing goes until February 24th. Save your spot!

Alteryx Designer Discussions

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

Macro Error Message - Tree Selections

8 - Asteroid

Hi all, 


I have a tree tool inside a marco that mimics a database setup ie. Level 1 = Database | Level 2 = Schema | Level 3 = Table | Level 4 = Columns


With that tree users can select columns from any table and download only the respective columns they have selected. Beucase they can select multiple columns I cannot use the 'Limit to one selection' inside the tree tool. 


My goal is now to display an error if a user selects columns from two different tables as this can cause an issue downstream and might not be noticed by a user if he accidentially selected columns from two tables. 


The expression should be something like 'IF Count(Selections Table/Schema/Database) > 1 THEN ERROR'






17 - Castor

You're trying to do too much processing in the action tool. I'm not saying it's impossible - but this is much easier to control downstream and post key join - where you can see the granular level of what's been selected in the Tree.


Attach the tree to a text input box via action tool and attach a browse tool - check out the results of the formatting of a multiple selection. I vaguely remember it's (xxx,xxx) perhaps you can create a logic for this using regex_countmatches - but I'd expect this is way easier downstream in workflow.

8 - Asteroid

HI @apathetichell thanks for the reply. 


I have tried a downstream tool which identifies if there is 2 selections and attached a test tool which throws an error is so, but it seems that the internal macro error does not show when the macro is run in another workflow...hence I wanted to try the error message tool instead.

17 - Castor

By downstream - I mean in the macro - outside of the action tool. Have the action tool update a text input. Test the results of your text input for multiple values.