Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

Dropdown List for Column Rename

mdata
8 - Asteroid

I would like to create a dropdown list where the column names can be renamed. I want to give the user the option of picking the column name to rename from a dropdown box instead manually renaming it or indexing. Any ideas on what is the best route?

9 REPLIES 9
KaneG
Alteryx Alumni (Retired)

Hi mdata,

 

You would start by populating the dropdown with the fieldlist. The important thing there is to connect the q from the Macro Input, not the arrow connector.

Then you just have to set up a text input so that you have the old field name and new field name so that you can run it into the dynamic rename.

 

I've attached the Macro if that method doesn't make sense.

 

Kane

mdata
8 - Asteroid

I have 2 file names here Named Book3 where macro input in coming from. The columns names in Book3 are incorrect but I want the user to pick and choose which columns names from file Column Names.   I would like multiple dropdown boxes with all the column names from the Book3 and all the Columns Names from Columns Names file.

 

 

2016-02-15_1048.png

mdata
8 - Asteroid

What I would like is all the column names of a file input in the dropdown box and be able to rename to any of the columns to right input file or text input. So if I have 8 coulmn names on the file coming in then there shuld be 8 drop down boxes with a matching right dropdown boxes.   Left dropdown boxes would have all the possible column names with the input file file and the right dropdown boxes will have all the column rename from right file input or text input.

KaneG
Alteryx Alumni (Retired)

Hi mdata,

 

So, you won't be able to make the number of drop-downs be dynamic, however, you can replicate out the tools in that macro to make as many options as you would like.

 

Change the second input tool to a dropdown instead of a text input. Then connect a text input tool that has each column named with one of the options that you want the user to be able to choose from. Then replicate this and have each set update the next row in the text input tool that feeds into the dynamic input.

 

I've left the connectors on this screenshot, but you can replicate out those containers and then make the connections wireless.

 

Image 001 - 20160216 - 130243.png

 

Kane

mdata
8 - Asteroid

I configured it just like you have but it does not give an options to update the column names. I know I can map with a macro but I may have 5 columns coming in and 15 columns to choose from to rename it to. Thanks! Attached is the macro.

PamW
Alteryx Alumni (Retired)

 

So I am not sure that this will do it for you but you can map field names and this changes the name on output.

 

The catch with map field names is that the incoming data must have a field that will match in order for this to work. I am attaching an example of using field maps for addresses in both a macro and an app.

 

Note that fields that go into a macro that are beyond the scope of the mapping are left alone but fields that get mapped come out of the macro with your assigned names. 

 

REnameFields.png

pamW
PamW
Alteryx Alumni (Retired)

The Map fields wasnt selected in your attachment however the map method only works when you have more incoming fields than fields to map to... that is all fields have to be mapped to something.

pamW
PamW
Alteryx Alumni (Retired)

So what you would have to do is make a drop down for each possible new name. The question would indicate the name they are changing it to and the action would update the old name field. So if you have fifteen options you would need fifteen drop downs.REnameFields2.png

pamW
mdata
8 - Asteroid

I found work around with this macro.img.png

Labels