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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
praveenk
Frequent Visitor

Expression.Error: We cannot convert a value of type Record to type Text.

Hello,

 

I am passing the below query and getting an error message in the response saying "Expression.Error: We cannot convert a value of type Record to type Text."

 

There are 3 mandatory parameters in the body, of which category id is an integer and the other two are string data types. Any suggestions would be appreciated to fix the error.

 

let
url = "https://api.xxxxxx/report",
headers = [#"Content-Type" = "application/x-www-form-urlencoded",
#"Accept" = "application/json",
#"Authorization"="Basic Token"
],
body = [categoryId = 1, employeeId = "radmin", reportName = "Activity"],
response = Json.Document(Web.Contents(url, [Headers = headers, Content = Text.ToBinary(body)]))
in response

 

Error Message:

Expression.Error: We cannot convert a value of type Record to type Text.
Details:
Value=
categoryId=1
employeeId=radmin
reportName=Activity
Type=[Type

 

Thanks

1 REPLY 1
lbendlin
Super User
Super User

body is a record, not a text.

 

Please follow the documentation. Use Json.FromValue. https://learn.microsoft.com/en-us/powerquery-m/web-contents#example-2

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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