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
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
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?
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?
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
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"
Hi @nataliad18
Here's an example of what I was referring to in my previous post (Main.yxzp)
The macro config looks like this
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
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.