Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
9 | |
7 | |
6 | |
6 |