We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Macro to adjust the settings for all table tools within a workflow

nataliad18
8 - Asteroid

Hi everyone!
I need to create a macro that when dropped to a workflow will adjust all table settings within that workflow to the same one (that is not a default one). Could someone give me an idea how to build such macro as I am not getting enough information online to build one and I do not have enough experience with macros 😞 

Thank you!
Natalia

7 REPLIES 7
danilang
19 - Altair
19 - Altair

Hi @nataliad18 

 

Unlike Excel, where you can write a junk of VBA in a macro and have it do almost anything to the spreadsheet that its contained in, Alteryx macros are a grouping of tools that perform some data modification related purpose.   Alteryx macros can't change any properties of the tools contained in the workflow that the macro is included in. 

 

While it would be possible to make a separate workflow that opens a generic workflow as an html file and changes all the table settings, and writes it back out as a yxmd file, you can't reproduce the same functionality in a macro.

 

Dan

nataliad18
8 - Asteroid

Hi Dan!

Thanks for the reply!

Would it not be possible to have the macro then linked to each table tool in order for it to "action" it and set the parameters in the table tool to whatever the macro says it should be?

Nanoq
8 - Asteroid

hey nataliad
do you want to have the same output schema for all tables, regardless of what the input looked like?
As i understand it, you want a macro that changes the layout of a file to some fixed system?

 

danilang
19 - Altair
19 - Altair

@nataliad18 

 

The interface tools that you use in macros can only modify tools that are inside the macro.  They can't link to any tools that are outside the macro using action tools.  You can only pass data from a macro to a main workflow through the macro output tools.  These can only connect to the green data inputs on tools and not the lightning bolts.  

 

Sorry

 

Dan

nataliad18
8 - Asteroid

hey Nanoq,

 

I want the colours and the formatting to match, yes. As far as I understand, I should be able to link the table tool to the macro and then the table will have different settings instead of the "default" settings (the data, header, borders, table text colour, background colour and alternate colour"

danilang
19 - Altair
19 - Altair

Hi @nataliad18 

 

Here's an example of what I was referring to in my previous post (Main.yxzp)

 

danilang_0-1633951879044.png

 

The macro config looks like this 

danilang_1-1633951942558.png

 

Within the macro there are two table tools and the action tool modifies the text colour style of each to match what is selected in the drop down.  When you run this, the output of the table tools in the macro has the selected text colour.  The output of the table tool in the main workflow stays the default black.

 

You could technically add the user interface tools to the main workflow for all the settings that you want to change and connect them to all the tables.  This would change your workflow into an analytic app.  When run as an app(Magic Wand), or on a server, the user would be able to select the default values for all the style fields in the connected tables.  When run normally(Run button or CTRL-R) in Designer you'll get the default settings.  See attached MainAsAnalyticApp.yxwz for an example of this

 

Dan

  

 

nataliad18
8 - Asteroid

This looks quite close to what I want to do, but is it also posisble to change the background colour ? (instead of grey coloured lines, I would like green ones) 

Meaning I have parameters for colours of Data, Headers, Border and Table, and I also want the default font to be different. 

Don't mind linking it to each table - that is what I thought I would have to do anyway. 

Labels
Top Solution Authors