Hello all!
I'm using a file browse to navigate to an xlsx file that can have an unspecified number of columns, but the workflow only cares about 3 columns of data that are being mapped by the file browse tool. I would like to know if it's possible to retain the provided column headers for those 3 mapped columns, instead of them being overwritten by the column headers we have within our input tool? I know the dynamic rename tool exists, but I don't know how to apply it to this scenario since the field mapping overwrites the provided column headers. Any help or thoughts would be greatly appreciated!
Hi @michalikm,
May just be me, but I'm struggling a little bit to picture the problem you're describing.
You're using a file browse to navigate to an xlsx file? (input or output)? I don't often use a file browse but I just thought it's a way - for a macro or an app - to change the file input or file output.
If you're saying that your workflow has a dependency on three columns & that you suspect a user may select a file that doesn't contain these three columns & you want to force them into your workflow irrespective if they are contained in the selected file, you can do the following:
Let's pretend I'm using a formula tool that's referring to a column in a file that doesn't exist, it'll spit out an error like so:
We can be sneaky and just force the columns to exist though with the following trick:
Here, we put a text input on the canvas. We put our field names in the text input as it'll force them to be persistent on the canvas. Use a sample tool to get rid of the dummy rows of data and this will only retain the column headers. If you want specific column datatypes forced as well as the names, consider using a Select tool after the Sample tool or consider putting relevant dummy values in the text input underneath the column headers (the text input will infer the datatypes based on the column contents)
If I've missed the mark, could you explain your problem again or hopefully someone else can understand the request.
My apologies, I'm not the best at explaining (or understanding) Alteryx.
I've provided a simplified version of the workflow, but to hopefully better describe the scenario:
Hopefully this makes a bit more sense!
@michalikm
from the workflow, it has no issue to retain extra headers.
but, since it simplified workflow, i believe it pass through transpose or crosstab or summarise or other tools that can't retain extra header beside configuration.
the simplest way is add recordId in beginning and use join tool in the end.
Correct, the workflow has no issue passing through the additional headers. I need the workflow to retain the user-defined headers for the 3 columns being mapped, not how they are listed in our template (GEOGRAPHY, DEDUPLICATE1, DEDUPLICATE2). The purpose of the workflow will be different for each user, so I would like them to be able to retain their original column names on the output if possible. Is this possible when generating a field map on a file browse?
As an example --
User inputs a file with column headers "ZIP", "STORE", "RATE". Is there a way to retain those headers for our output, since the fields are mapped as "GEOGRAPHY", "DEDUPLICATE1", and "DEDUPLICATE2"?
@michalikm
i can't think anyway.
but you can try to do utilize list box.
it more freedom, but it do fit what you want, where retain the original field name.