Alteryx Designer Desktop Discussions

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

JSON To Table format

tjamal1
8 - Asteroid

I am trying to Parse JSON and then convert into the table format 

 

 

I am getting this result after parsing and some cleansing 

JSON_NameJSON_ValueString
id4780
employeenameParis Hessel
employeesalary1860
employeeage56
profileimage 
id4782
employeenameChere Funk I
employeesalary1252
employeeage67
profileimage 

 

 

I want to convert it into Table  format like this

idemployeenameemployeesalaryemployeeageprofileimage
4780Paris Hessel186056 
4782Chere Funk I125267 
7 REPLIES 7
Thableaus
17 - Castor
17 - Castor

Hi @tjamal1 

 

You can use a combination of Multi-Row Formula with Transpose Tool.

Crosstabmultirow.PNG

 

transposetool.PNG

 

- IF [JSON_Name] = "id" then [Row-1:Rank] + 1
ELSE [Row-1:Rank] ENDIF - Multi-Row Formula

- Transpose grouping by the Rank field created in the Multi-Row Formula Tool.

 

WF attached.

 

Cheers,

JosephSerpis
17 - Castor
17 - Castor

Hi @tjamal1  I made a small change to your workflow and got the results you described.Sample_API.JPG

tjamal1
8 - Asteroid

Thanks for the reply 

Its working for me. 

An elegant use of Regex 🙂 


tjamal1
8 - Asteroid

Thanks for the reply.

Its working.

Can you please briefly elaborate Multi row formula you have used 

Thableaus
17 - Castor
17 - Castor

@tjamal1 

 

It's pretty simple. You're basically grouping values in your column with a row number (rank) when you see the word "id".

 

IF [JSON_Name] = "id" then [Row-1:Rank] + 1
ELSE [Row-1:Rank] ENDIF

 

If you happen to find "id" in your JSON_Name, you add 1 row number (+1)

else you're in the same row as your "id", so just repeat the row before ([Row-1:Rank])

 

Cheers, 

Kristaps
5 - Atom

Hi Joseph,

 

I am starter in Alteryx and tried to replicate your logic, however I am getting error "Couldn't resolve host name".  I am taking data directly from Salesforce Input. I am trying to get data from existing reports, however I am just getting one line "JSON".  My goal is to get this is table format.

 

Thank you very much in advance,

 

Kris

jayviz
7 - Meteor

This helped me to parse that data and convert to a table format.

 

Is it possible to define data types for the columns parsed from the json ?

Labels