community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Get a list of fields in a table

Highlighted
Asteroid

I have a set of 32 tables I would like to apply the field info tool so I get a single list of fields

I started building a standard workflow until I saw this should be a batch macro - my first one

 

Below is the macro so far.   

Capture.JPG

 

It's pretty straightforward.  I pass in a list of tables and each time, replace the table name piece in the input tool (SELECT * FROM <table>).  The parse is used to remove everthing but the tablename in the source column

 

I configured the interface to autoconfigure by name but I am only getting the first field in the first table.  Also, I can't add a browse after calling the macro

Not sure what I'm missing but any wink,wink,nudge,nudge would be appreciated.  I would really like to shift into macros.   Thanks in advance.

Alteryx Certified Partner
Alteryx Certified Partner

So I was able to get this working.

 

First thing I would suggest is to use the query 'SELECT TOP 1 * FROM <table>' If you are only trying to get the field names.

 

Using my Input tool, I connected to a table in my database. Then, using the control parameter and action tool, I updated my connection string to replace the table name.

 

Capture.PNG

 

Then, like you, I used a field info tool and set the interface to 'Auto Configure By Name'

 

Then I save my batch macro and open up a new workflow.

 

Capture2.PNG

 

Make sure to configure your macro by selecting the appropriate field for your control parameter

Asteroid

Can you share the workflows?

Labels