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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jmillsjmills
Helper III
Helper III

Can I extract the error message as a text string?

I'm getting an error message that when I click into it, it says:

 

DataFormat.Error: We found extra characters at the end of JSON input. 

Details:
Value=;
Position=805732

 

I would like to convert this error message from being along the yellow bar to being text in a table with one row and one column. That's all I need to know how to do - do you have any ideas please?

 

Thanks!

 

For what it's worth, it's because this number in my error message can also be my solution to the error. If I can extract 805732 - a number that will change each time I run the query - I can dynamically handle this error. If I extract "805732" and convert it to a number, I can then change the original JSON input using the Text.Start function (trimming off the extra characters that cause the error).

 

So all I need to do is take the error message and have it returned in the table, so I can manipulate the output.

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @jmillsjmills ,

 

Here's a blog about how to extract the error message in Power Query, you could have a try.

https://www.sumproduct.com/blog/article/power-query-blogs/power-query-trying-to-extract-errors

Use the try function to extract error message. For example,

add a custom column with try function.

vstephenmsft_1-1652345109636.png

You'll get a column with records. Expand the error.

vstephenmsft_2-1652345157731.png

vstephenmsft_3-1652345197418.png

vstephenmsft_5-1652345222413.png

Continue to expand the message.

vstephenmsft_4-1652345214268.png

vstephenmsft_6-1652345259507.png

 

You can expand what you want according to your needs.

 

 

 

Best Regards,

Stephen Tao

 

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

 

View solution in original post

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @jmillsjmills ,

 

Here's a blog about how to extract the error message in Power Query, you could have a try.

https://www.sumproduct.com/blog/article/power-query-blogs/power-query-trying-to-extract-errors

Use the try function to extract error message. For example,

add a custom column with try function.

vstephenmsft_1-1652345109636.png

You'll get a column with records. Expand the error.

vstephenmsft_2-1652345157731.png

vstephenmsft_3-1652345197418.png

vstephenmsft_5-1652345222413.png

Continue to expand the message.

vstephenmsft_4-1652345214268.png

vstephenmsft_6-1652345259507.png

 

You can expand what you want according to your needs.

 

 

 

Best Regards,

Stephen Tao

 

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

 

Thanks so much!

watkinnc
Super User
Super User

Check out Ben Gribaudo's article here:

 

https://bengribaudo.com/blog/2022/02/21/6561/enhancing-an-errors-detail#more-6561 

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors