Free Trial

Alteryx Designer Desktop Discussions

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

Dynamic number of colmuns in the File Input from a Macro Input Tool

mathias_schnoor
11 - Bolide

Hey,

 

when I build a macro and use the Macro Input Tool, I connect the Macro Input Tool with a CSV-File from my directory.

The CSV-File have a saved number of columns.

 

When I use my build macro a must connect the macro input with a file from the Data Input Tool, that always has the same number of columns as my connected CSV-File in the macro workflow.

 

Is there a possibility to make the number of columns dynamically withhin the Macro Input Tool?

So can I make a decision only at runtime, how many columns my connected file from the Data Input Tool should have.

 

Mathias

8 REPLIES 8
jdunkerley79
ACE Emeritus
ACE Emeritus

If you connect another data source with extra columns they will be passed into the macro.

 

Assuming you don't need specific fields, I would deselect the field map option on the macro input.

 

If your output set depends on input make sure you tick box in the interface designer as well.

outputChanges.jpg

 

Have attached a really simple demo just reading out the metadata passed in

mathias_schnoor
11 - Bolide

Thank you for your support

but your solution works not for that what I mean.

 

I have attach your an example.

 

The Macro Input Tool is connect with a CSV-File with four columns.

 

In the workflow I have only a connect with three column. The macro expected four columns.

 

So the macro did not work.

 

dynamic_number_of_fields.JPG

 

 

Please have a look to my attachment.

jdunkerley79
ACE Emeritus
ACE Emeritus

Ah misunderstoof the problem, had assumed extra columns.

 

I believe you would need to solve this by preparing the data outside of the macro. In other words before entering use something like a formula tool to add the missing columns.

 

Alternatively you could change your macro so the sample in the Macro Input has only has the bare minimum set of columns, and then the field chooser would only require those columns. 

 

Hope that helps

mathias_schnoor
11 - Bolide

Thank you for your support.

So I must use the defined number of columns from the Macro Input Tool in the macro everytime.

I had hoped that there is a feature and I can defined the number of columns dynamicly.

That's a pity.

AlexKo
Alteryx Alumni (Retired)

Hi Mathias,

 

@jdunkerley79 mentioned "Assuming you don't need specific fields, I would deselect the field map option on the macro input."

 

Just to clarify, I'm attaching a screenshot of where this option is located.

 

Capture.PNG

Alex Koszycki
Program Manager, Community Platform
jdunkerley79
ACE Emeritus
ACE Emeritus

Had another play, think you might be able to achieve what you want with something like the attached macro.

 

Effectively you add missing columns as first step within the macro so all the data you need is there. Only the bare minimum columns get exposed.

 

Disadvantage is no way to list all fields to input flow

jdunkerley79
ACE Emeritus
ACE Emeritus

Had another play, think you might be able to achieve what you want with something like the attached macro.

 

Effectively you add missing columns as first step within the macro so all the data you need is there. Only the bare minimum columns get exposed.

 

Disadvantage is no way to list all fields to input flow

mathias_schnoor
11 - Bolide

Thank you for your support.

 

That would help is an funktionalty to connect a column of the Input Data Tool with the macro twice.dynamic_number_of_fields_20160211.JPG

 

 

Labels
Top Solution Authors