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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
hmeltonPSL
Helper II
Helper II

We found extra characters at the end of JSON input

I am trying to write the following query so I can include project description from azure devops in my powerbi report.  The URL works fine on its own and get JSON back..howver when I put it in the following function in POwerBI I get the error below.  

 

Any ideas?  thanks

 

= (projectid as text) as binary =>
let
Source = Json.Document(Web.Contents("https://dev.azure.com/ORGNAME/_apis/projects/" & projectid & "?api-version=6.0"))
in
Source

 

 

An error occurred in the ‘’ query. DataFormat.Error: We found extra characters at the end of JSON input.
Details:
Value=
Position=4

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @hmeltonPSL 

 

Since "The URL works fine on its own and get JSON back", you can try using Web connector in Power Query Editor to connect to this URL and test whether it can get the result back. You will need to enter credentials before connecting successfully. Power Query will detect the format of the data it gets and convert it to JSON format automatically. 

 

If you can get correct result from the URL through Web connector, then you can use a query paramter to replace the projectid part in the URL. At last, in Queries pane, right click on the query and select option Create Function. This method is to use UI to create a function. You can compare its M codes and your codes to see which the difference is that may cause the error.

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it. Kudos are also appreciated. Thanks!

ImkeF
Community Champion
Community Champion

Hi @hmeltonPSL ,

nothing obvious comes to my mind here. 

I would debug as follows:

1) remove the "as binary" from the function:

 

(projectid as text)  =>
let
Source = Json.Document(Web.Contents("https://dev.azure.com/ORGNAME/_apis/projects/" & projectid & "?api-version=6.0"))
in
Source

 


2) if 1) doesn't help, then run the function without Json - conversion:

 

 

(projectid as text)  =>
let
Source = Web.Contents("https://dev.azure.com/ORGNAME/_apis/projects/" & projectid & "?api-version=6.0")
in
Source

 

You can then parse the result in a separate step/column with the "Text.FromBinary"-function and try to figure out what's wrong with the JSON.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.