Alteryx Designer Desktop Discussions

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

Input file either csv or xlsx

Dhilip_Kumar
8 - Asteroid

Hi All,

 

We received input file either csv or xlsx file format so we have to process out workflow on both types. Headers also not given on both type input files so we need to extract entire data and adding header manually for both csv and xlsx format. I have attached my workflow and input and expected result. please do the needful.

20 REPLIES 20
Prometheus
12 - Quasar

@Dhilip_Kumar Is the error calling out the file that the Dynamic Input is mapped to? Are the Dynamic Input tools mapped to existing files? The file that you map the Dynamic Input tool is not the file you're trying to open. It's just a placeholder that will be replaced by the incoming FullPath from the Directory tool.

DI Config XLSX.PNG

DI Config CSV.PNG

 

This is what happens when I run the workflow and nothing is in the folder that the Directory tool is mapped to.

No Files to Input.PNG

Dhilip_Kumar
8 - Asteroid

@Prometheus  I had only csv file as input file for this workflow that is why we got error on xlsx part i believe. If we put some dummy xlsx file in the folder then we do not get any error but if we put any dummy data headers are update twice since we use join tool to connect xlsx and csv. Please advise me.

Prometheus
12 - Quasar

@Dhilip_Kumar By input, do you mean that you have only a CSV in the folder that the Directory tool is pulling in from? I was asking if your Dynamic Input tools are mapped to existing CSV and XLSX. One needs to be mapped to an existing CSV and the other needs to be mapped to an existing XLSX. Then if there's no CSV or there's no XLSX, there's also no error.

This is what it looks like when I have no CSV in the input folder:

No CSV.PNG

 

This is what it looks like when I have no XLSX in the input folder:

No XLSX.PNG

No errors.

Dhilip_Kumar
8 - Asteroid

@Prometheus let me answer your question first,
By input, do you mean that you have only a CSV in the folder that the Directory tool is pulling in from? - Yes
I was asking if your Dynamic Input tools are mapped to existing CSV and XLSX. - Yes

So you said, if we mapped to existing CSV and XLSX it means we need to keep one CSV and XLSX file particular folder always?

Dhilip_Kumar
8 - Asteroid

@Prometheus I can see your above workflow but i got error while merging those two output into one result. So could you please advise how could get the result on your workflow. I need only one sheet as output either the input format is CSV or XLSX.

Prometheus
12 - Quasar

@Dhilip_Kumar I'll answer your question first. "So you said, if we mapped to existing CSV and XLSX it means we need to keep one CSV and XLSX file particular folder always?" No. The folder that the Directory tool is mapped to can be empty, like this:

No Files to Input.PNG

The Dynamic Input tools have to be mapped to something that exists, like this:

CSV mapping.PNG

XLSX mapping.PNG

I'm not actually pulling in data from either of these files. They're just serving as placeholders. The path to open them will be replaced by the FullPath from the incoming Directory tool.

Dhilip_Kumar
8 - Asteroid

@Prometheus Could you please advise how to get output as single sheet for both xlsx and csv. That would be helpful to me.

Prometheus
12 - Quasar

@Dhilip_Kumar Try this.

Dhilip_Kumar
8 - Asteroid

@Prometheus I apologies for continuous questions. I tried this workflow got same error. I have attached my workflow and error message with configuration settings of input.

Please edit that workflow and help me.

Prometheus
12 - Quasar

@Dhilip_Kumar From what I can see in your workflow, you haven't mapped the Dynamic Input tools to existing files. 

Go to the Dynamic Input tool and click on "Edit."

DI Config XLSX.PNG

 Then click on "Set up a connection"

XLSX mapping.PNG

Then select an XLSX file to connect to. You'll know you have a good connection when you see data in the bottom part of the above screenshot -- Preview (first 100 records). Make sure your Dynamic Input tool is going to read in the FullPath from the Directory tool by clicking on the radio button next to "Read a List of Data Sources." Select "FullPath" from the "Field:" dropdown menu, then select "Change Entire File Path" from the "Action:" dropdown menu.

Read List of Data Sources.PNG

When you run your workflow, the FullPath from the Directory tool will replace the path to the file you selected. You should not have errors.

Labels
Top Solution Authors