Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
d3nnls
Frequent Visitor

Power BI can't parse a JSON response from SonarQube API

Hello everybody,

 

I have a curious problem when querying the SonarQube API using the Web Get Data option. SonarQube is a tool used for continuous inspection of code quality. It contains various metrics related to code inspection. Let's get to the matter at hand.

 

I've three calls to the API looking similarly to this:

  • https://<on-prem-server>/sonarqube/api/measures/component?metricKeys=ncloc,complexity,violations,blocker_violations,bugs&component=<project_id> --> this returns a json in the browser, but Power BI returns access prohibited even though I am an admin in SonarQube
  • https://<on-prem-server>/sonarqube/api/components/search?qualifiers=TRK,SVW,APP --> this returns a json in the browser, and Power BI successfully parses this response allowing for further data processing
  • https://<on-prem-server>/sonarqube/api/issues/search?componentKeys=<project_id> --> this returns a json in the browser, but Power BI is unable to parse the response, and only parses the top level, but the subsequent list is empty (see images)
 
 

 

                                                             Top level parsed

Top level parsedTop level parsed

                                                                  issues list is empty

Issues list is emptyIssues list is empty

 

Other remarks: 

 

  • I am an admin in SonarQube in the company (and the credentials seem to be fine)
  • Downloading the JSON response of the second query from web browser and manually importing it in Power BI works just fine

 

Does anybody know what the problem could be?

Thanks for any help!

 

With best regards,

Denis

 

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi  @d3nnls 

What is your M code in your power query, I think you need "Json.Document" to parse it.

Here is a blog, you could refer to it:

https://www.thebiccountant.com/2017/08/30/how-to-open-a-complex-json-record-in-power-bi-and-power-qu...

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi @v-lili6-msft ,

 

my M query looks like this after trying the solution. (Json.Document was part of the original query - the original looked the same as the one below if we omit the second line in the let block )

 
 
 
d3nnls
Frequent Visitor

I am sorry, the image didn't go through.

 

M queryM query

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors