Alteryx Designer Desktop Discussions

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

Download tool (API) - Parse results from DownloadData column

Analyst323
8 - Asteroid

Hi!

 

Running into an issue on parsing out data from the "DownloadData" column.  Typically I see JSON formatted (and can use the JSON Parse tool) from the API but this error log is producing a comma delimited output. 

 

How can I get the first row to be headers and output the results as a CSV?

 

 

10 REPLIES 10
TimN
13 - Pulsar

Something like this...

AndrewDMerrill
13 - Pulsar

You don't technically need to do anything. Just isolate that column with a Select Tool, and then output to CSV with the following settings:

Screenshot CSV.png

Analyst323
8 - Asteroid

Solution found below. Thanks though!

Analyst323
8 - Asteroid

Hey that worked! Thanks so much.


Could you explain those settings? Just want to make sure I understand what's happening. 

 

AndrewDMerrill
13 - Pulsar

I cannot open the Output.txt file on my system for some reason, but the format I sent should only output the contents of that single cell into a csv which will include the headers too. Unless you don't want the headers at all in the csv output, in which case, you will need to do a little finagling to get rid of that row from the text in the cell.

 

Here is another version of the workflow that would accomplish that.

AndrewDMerrill
13 - Pulsar

Since that cell basically just contains the contents of a csv file, all you need to do is take the contents of the cell and move them over to an empty file. From top to bottom our Output setting do the following:

2. File Format: obvious

3. Delimeters: "\0" just means don't use delimiters (This is where the magic happens that lets the output not be considered a single block of text because quotes will not be added to the output). This is contrasted against leaving the field blank, which tells the system to use the empty string as the delimiter (i.e. "\0" = DO NOT USE delimiter; [Blank] = USE "" AS delimiter)

4. First Row Contains Field Names: Leave this unchecked because we do not want Alteryx to use the column name "DownloadData" in the output, rather you want to sneakily insert your own column names, which came to you courtesy of the Download Tool output and sits patiently in the single cell with all the other data.

5. Quote Output Fields: I just wanted to make sure the output didn't put quotes around all the text and turn the output into a single cell in the csv (this may not have been necessary at all)

8. Write BOM: Not relevant to your specific use case has to do with UTF-8 encoding (for fun though: https://en.wikipedia.org/wiki/Byte_order_mark here is a wiki article on it)

Analyst323
8 - Asteroid

Thank you so much for the detailed reply! 

Analyst323
8 - Asteroid

Hi Andrew,

 

Is there a way to view these results in Alteryx without having to export it to a CSV first? Meaning, I would like to parse the data in alteryx from the download data column in it's entirety and then use the results in a join tool to identify which records I'm missing from another data source. 

Maybe dynamic input?

AndrewDMerrill
13 - Pulsar

Here is a sample workflow that parses CSV input:

Screenshot.png

Labels