Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

How Convert or Flatten a Nested JSON

carltonp
8 - Asteroid

Hello Community,

 

I have been exploring Alteryx now for about 3 months. I'm very excited with its possibilities.

 

Can somoene let me know how Alteryx deals with Nested JSONs? 

 

For example I'm able to flatten the attached Nested JSON to CSV by simply dragging the Json to any online JSON to CSV converter.

 

Is it possible to use of the Atleryx tools to do something similar?

 

So, basically, I would like to convert or flatten the attached JSON to CSV with Alteryx

 

Thanks

14 REPLIES 14
Luke_C
17 - Castor

Hi @carltonp Do you have a sample output you could share? Have you tried the JSON Parse tool? Typically the first step to flattening json is using a JSON parse tool followed by a crosstab tool.

gautiergodard
13 - Pulsar

Hi @carltonp 

Do you have a sample of what the final data would look like. 

Alteryx provides a JSON parse tool, however depending on the structure of your data you may need to do some additional data massaging. In my experience its typically a combination of the record id, transpose/cross tab, and text to columns.

Felipe_Ribeir0
16 - Nebula

Hi @carltonp 

 

Yes, it is possible. Take a look at the attached workflow, you usually can do it for any JSON using these same steps.

 

Felipe_Ribeir0_0-1665419438163.png

 

If the provided answer helped you to solve the problem/was correct, please accept it as a solution :)

 

Thanks.

carltonp
8 - Asteroid

Hi Luke, 

 

Thanks for reaching out. 

 

Please find attached a sample output.

 

Regards

carltonp
8 - Asteroid

Hi Felipe,

That's great. I can't wait to test it on my json.

In the meantime, I have sent a sample output

carltonp
8 - Asteroid

Hi Feliple,

 

The workflow is missing the companyId

Felipe_Ribeir0
16 - Nebula

Hi @carltonp 

 

added the field.

Felipe_Ribeir0_0-1665423143721.png

 

carltonp
8 - Asteroid

Hi Felipe

 

Thanks for reaching out again. However, there is something strange going on with your output.

If you look at my output, there should only be 3 rows with the following company Ids

 

00041424

00053417

00048796

 

But you only have output for 00041424. Or am looking at this incorrectly? How would this look if exported to a CSV file.

 

Take a look at my output

Felipe_Ribeir0
16 - Nebula

@carltonp  you are right, something got missing when it was inputed. Give me some minutes, gonna try to figure out.

Labels