Alteryx Designer Desktop Discussions

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

API and JSON

Drole
7 - Meteor

Hi there 

 

I have a API and a JSON file, but I have never worked with json files before, and dont know how to go about with this.  Any help ? 🙂

 

https://data.brreg.no/enhetsregisteret/api/enheter/

 

Best regards

7 REPLIES 7
MatthiasSeil
Alteryx Alumni (Retired)

Hello,

 

The best way is to use the Download tool in order to get the data from the URL into Alteryx and then simply the JSON Parse Tool to "decode" the data. Both in the developer category.

MatthiasSeil_0-1624288141231.png

 

 

It can then simply further processed by other Alteryx tools.

 

Please see example attached.

 

Kind regards

 

Matthias

 

 

Drole
7 - Meteor

Thanks for the attached workflow.  But how do I go from there, and how can I get the data into different columns?

MatthiasSeil
Alteryx Alumni (Retired)

That works then with the "classic" prep and blend tools like formula, transpose, cross tab, etc.

Based on the initial formatting of the json by its issuer it can be that it's not automatically in the format you'd like to have it.

Could you scetch an example of your desired output scheme?

BrandonB
Alteryx
Alteryx

@Drole after you use a JSON Parse tool you will notice that it will create a JSON Name column and a JSON Value column. JSON stands for JavaScript Object Notation and the JSON Name column will have a period separator. You normally follow the JSON Parse tool with a Text to Columns tool where you split the JSON Name column into however many columns are needed and then use a Crosstab tool to pivot the data. You will also notice that there will be one of the column that has a numerical value that indicates the block of values that will make up each row after transforming the data. You will want to check the box to group by this column. 

BrandonB
Alteryx
Alteryx

BrandonB_1-1624296116226.png

 

 

BrandonB_0-1624296080119.png

 

Venkatesh1122
5 - Atom

I have API and i Nedd to do Json Parsing the downloaded data is in html format how i can do JSON Parsing can any one help me in that?

BrandonB
Alteryx
Alteryx

@Venkatesh1122 I am pretty sure that you copied the safelinks version of the URL rather than the actual endpoint you are looking for: 

 

BrandonB_0-1675963928213.png

 

Many organizations run URLs through this when opening from email to check if they are safe first. I would first open the URL in a browser and then copy the actual URL from there. 

 

Additionally, JSON parsing is not used on HTML, as the HTML is simply the formatting code that is returned from a webpage. If you are expecting JSON elements to be returned it likely indicates that your URL endpoint is not correct. 

 

Labels