Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Parse a CSV into a JSON

Daniel_Figueredo
7 - Meteor

Hello all!

 

I'm building a workflow that JOINs the data between two inputs (CSV and JSON) and if the data is in both records I need to parse the output back into a JSON in order to call an API.

 

I've managed to build the former, therefore, my problem is with the latter, since I'm struggling on how to parse the result back into a JSON to match whats expected by the API, is it possible to do this with alteryx?

 

Unfortunately I can't provide any prints of the workflow itself nor the data.

 

Thanks in advance.

 

 

 

3 REPLIES 3

Hi @Daniel_Figueredo 

 

Have you tried to use Json Build building block? Here is an example of how it works. Cheers!

 

christine_assaad_0-1605022512815.png

 

christine_assaad_1-1605022539196.png

 

Daniel_Figueredo
7 - Meteor

Hello!

 

I've tried using the JSON build tool but I failed to configure it properly. Since it comes out as a table I need the column names to be the keys and the rows to be the values.

 

Example:

 

ID         Name        Company

1           gmail          google

2           outlook       microsoft

 

I need that input to amount to:

[
{
"ID": 1,
"Name": "Gmail",
"Company": "Google"
},
{
"ID": 2,
"Name": "Outlook",
"Company": "Microsoft"
}
]

Hi @Daniel_Figueredo 

 

Perhaps a Transpose could help like in the below?

 

christine_assaad_0-1605031434429.png

 

Labels
Top Solution Authors