This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
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'
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.
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.