Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Macro Text Input - Column Rename

IJReed
8 - Asteroid

Hi Alteryx Community!

 

I am new to creating macros and am running into some trouble. I am using a a "Text Input" in the Macro Input tool. The Macro is asking the user to choose:

 

1)     Primary Key Field

2)     Latitude Field

3)     Longitude Field

 

Macro Input Configuration.PNG

 

As expected, the Macro's output keeps the name of these three fields as "Primary Key", "Latitude", and "Longitude". However, I would like the Primary Key field to be renamed to whatever the user selects to use as their primary field (rather than the output simply calling that column Primary Key)

 

For example, if the user selects Store, City, or SiteNumber as the Primary Key input.... then the output should also be Store, City, or SiteNumber (rather than it defaulting back to being called "Primary Key")

 

Thanks!

10 REPLIES 10
BenMoss
ACE Emeritus
ACE Emeritus

The way i do this is to do what appears to be the case  now, i.e. they are renaming, thus it moves through the workflow as Primary key, latitude and longitude, I then place a select at the end of the workflow, which through an action from the drop down interface tools renames them back to what they were as specified by the user.

 

If you were to upload your example workflow perhaps I could intergrate this solution for you.

 

Ben

BenMoss
ACE Emeritus
ACE Emeritus

Something like this...

 

 

AdamR_AYX
Alteryx Alumni (Retired)

The other option if you want to continue to use the "Field Map" option for the macro input is to use a select tool at the end and update it with a "Update Select With Reverse Field Map" action.

 

See attached

Adam Riley
https://www.linkedin.com/in/adriley/
daniel_mmi
9 - Comet

So *that's* what that does! Totally useful (if obscure) feature. Thanks!

Korpelak
8 - Asteroid

Adam/Ben, I am trying to create a similar macro but adding the summarize tool before output. I wanted it grouped by the primary key and then a count.

It works fine with the count alone but as soon as I add the group by the workflow breaks. Any thoughts?

SophiaF
Alteryx
Alteryx

@Korpelak - can you package up this workflow so the macro is included? In Designer, Options > Export Workflow

 

Thanks!

Sophia Fraticelli
Senior Solutions Architect
Alteryx, Inc.
Korpelak
8 - Asteroid

@SophiaF  Sure thing! Apologies for my mistake. See attached.

SophiaF
Alteryx
Alteryx

@Korpelak - looks like you just need to move the Action tool to the end of the workflow (having it at the beginning was changing the fields immediately, so the macro was referencing fields like "Summarize" and since it was renamed, it couldn't find it). Also, the Action tool is looking for an exact match on field name - since you are mapping the user inputted field to the field "Summarize", if you don't have the field "Summarize" in the Select tool the Action is acting on, it won't know which field name to update. I just changed the field name from "Summarize On" to "Summarize" in the Select prior to the Formula.

 

fmtabr

Sophia Fraticelli
Senior Solutions Architect
Alteryx, Inc.
Korpelak
8 - Asteroid

thank you @SophiaF, it works! Oh I am so grateful for this community, I stared at this for hours last Friday.

Karina

Labels