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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Ben-Dev
Helper II
Helper II

M Language - Error Records' New Fields (Message.Format & Message.Parameters

Hello,

 

At some point in the not too distant past, error records were expanded from three fields (Reason, Message, Details) to five fields (with the addition of fields Message.Format and Message.Parameters). Can someone from Microsoft detail the exepection for how these fields should be used/work? 

 

A guess is that these fields are provided to support a form of structured logging, for example, by setting Message to something like "Some Message - count: {count}, code: {code}" and then setting Message.Parameters to a list of two items.

Error.png

 

However, this is just a guess. Official confirmation/details would be most helpful.

 

Thanks!

 

/CC: @Ehren 

1 ACCEPTED SOLUTION
Ehren
Microsoft Employee
Microsoft Employee

Your guess is correct. 🙂

 

Here's an example:

error [
    Message.Format = "Hello #{0}.",
    Message.Parameters = {"world"}
]

View solution in original post

4 REPLIES 4
Ehren
Microsoft Employee
Microsoft Employee

Your guess is correct. 🙂

 

Here's an example:

error [
    Message.Format = "Hello #{0}.",
    Message.Parameters = {"world"}
]

Thanks, @Ehren, for the quick reply!

 

A couple questions:

  • Are the parameters pared with the {something} placeholders in the message positionally? So the first parameter in the list goes with the first placeholder in the message, the second param with the second placeholder, etc.? (Think the answer is "yes.")
  • What is the difference between error fields Message and Message.Format? Error.Record sets them to both be the same value, but I'm guessing they are separate fields because there may be reasons for them to have different values.
  • Is there any way to get the mashup engine to fill in the placeholders when rendering the error out in the UI? For example, "error Error.Record("Some Reason", "Some Message - count: {count}, code: {code}", null, {123, "abc"})" is rendered without giving the user any clue as to the placeholder's values. Should the UI be filling in the placeholders when displaying the error?
    Error rendering - with params.png
Ehren
Microsoft Employee
Microsoft Employee

See the example I added above after my initial response.

Thanks, @Ehren!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Kudoed Authors