Alteryx Designer Desktop Discussions

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

Account for field names changing

gwiz
8 - Asteroid

I have a macro that has a macro nested in it. One of the macros has two input files that I join together. There are three macro outputs too. I tried adding three select tools at the end and then mapping one of the macro inputs to each of those select tools, using the "Update Select with Reverse Field Map" option. But when I go to use the macro in a workflow I get a error that the field "Store" is not contained in the record. It's not, because the new data is using "Shop". Not sure how to fix this!

6 REPLIES 6
ddiesel
13 - Pulsar
13 - Pulsar

Hi @gwiz !

 

In the macro, check out the Interface Designer Settings - Properties. Under "Output Mode", the default is "All Iterations will have the same output schema (Error if different)". Try either Auto configure by Name or Auto Configure by Position.

 

Let us know if this resolves your issue. If not, there are a couple other ways to tackle it.

gwiz
8 - Asteroid

@ddiesel thanks

That works if it is a batch macro. I changed it to a batch but now it doesn't work by doing that. 😕

JoeS
Alteryx
Alteryx

Hi @gwiz 

 

You will need to use some more questions and actions within the macro.

 

You can use the field map option, but I am less keen on that, however it is a quick resolution.

 

Or you can start to map fields into place holders in your macro AKA "JoinField1", "JoinField2" etc.

 

Use them within the macro and then allow everything else to pass through as "Unknown"

gwiz
8 - Asteroid

@JoeS thanks for answering a bit.

I am not sure I know how to carry out what you are saying. Do you mind showing me an example of what you mean?

ddiesel
13 - Pulsar
13 - Pulsar

Hi again @gwiz !

 

@JoeS  recommended a good approach. "JoinField1" and "JoinField2" are just placeholders that are not expected in the files you're inputting, but by checking "Unknown" all fields will pass into your workflow and be available to Join. 

 

Depending on your file types, you can also try to input your files with default names. In Input Data, check 6|First Row Contains Data and your fields will import as F1, F2, etc. This might work well if your fields are always in the same order, and then you can rename downstream.

 

I'll leave to Joe to respond, but it might be easier if you upload your workflow with some dummy data.

JoeS
Alteryx
Alteryx

Hi @gwiz 

 

I have attached a very simple version here:

 

2019-12-04_10-05-10.png

 

The formula set up my dummy fields. I prefix them with "NonRepeatable" so not to ever overwrite an existing column on your data, in the assumption you won't have a field called "NonRepeatableJoinField1", whereas JoinField1 may, although unlikely, exist on your data.

 

The Dynamic select can then remove my dummy/working fields by !Contains([Name], "NonRepeatable")

 

 

Labels