Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

JSON Error - Not reading in all data

DataBlender
11 - Bolide

Hi everyone,

 

I'm trying to input a json file which is a union (I think) of a number of different webpages which have been scraped. My issue is that only the first of these pages seems to be coming through and I also receive a warning message: 

 

Input Data (1) Error message: The document root must not follow by other values. at character position: 143856

 

I have a csv file which contains the same data and I can see that this has all of the pages. The reason I'm using the json file rather than the csv is so that I can keep the column headers from each page.

 

Separately, this has all come about because I was unable to correctly parse the page directly through Alteryx. This is also included in the sample workbook in case anybody would like to look at that as well!

 

Thanks

DB

 

 

6 REPLIES 6
KaneG
Alteryx Alumni (Retired)

Hi @DataBlender,

 

Your JSON file is indeed a whole lot of JSON files unioned, but that is easy enough to deal with. Bring it in and configure the input tool as CSV with no delimiter:

 

Image 001 - 20160718 - 120727.png

 

Then add a recordID and put it through the JSON Parse tool. Note that your schema changes after record 406 and so you might want to split on that before cross-tabbing your results.

 

Kane

DataBlender
11 - Bolide

Thanks @KaneG!

nicks10
6 - Meteoroid

Had the exact same issue as DataBlender - great solution, thanks!

steng
6 - Meteoroid

Hi! I tried the similar method yet the nested JSON data was lost during the process. As you can see in the output after Transpose, the attribute returns all null values. Is there anyway to fix this? Thanks a lot in advance!

KaneG
Alteryx Alumni (Retired)

You'll have to set the Input Tool: "Field Length" to a high enough value that it does not truncate the values. Also de-select the "First Row Contains Field Names" checkbox.

 

With this data, I would also advise playing around with the dynamic Select in order to separate the attributes fields

steng
6 - Meteoroid

Thank you so much!!! Looks like I overthink this problem way too hard haha

 

Will see what I can do with Dynamic Select! Really appreciate your help!

Labels