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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NewParrot
New Member

Expression.Error: We cannot Convert a value of type List to Text

Hi all. 

I am currently working of getting data from a web application into PowerBI.  After a bit of work setting up the right request body using content, i know seem to have a type problem. 

I am fairly new to PowerQuery and PowerBI, having only used Python to interface with API's before. 

My current M code i as follows(with redacted API key): 


let
headers = [#"authtoken"="##Hardcoded API Token##"],
input_data = {"input_data:
{
""list_info"": {
""row_count"": 20,
""start_index"": 1,
""sort_field"": ""subject"",
""sort_order"": ""asc"",
""search_fields"": {
""subject"": ""CIS""
}
}
}"},
Source = Json.Document(Web.Contents("https://servicedesk.ntg.com/api/v3/requests", [Headers = headers, Content=Text.ToBinary(input_data)]))

in
Source

and it is showing the following error: 

Expression.Error: We cannot Convert a value of type List to Text

Details:
Value=[List]
Type=[Type]

 

The expected responce body format looks like this: 

NewParrot_0-1699542305867.png


Can anyone shed some light on a fix, or potential ideas for how to get better understanding of the error? 




1 REPLY 1
watkinnc
Super User
Super User

You need to put quotes before the first brace and after the last brace.

 

--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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors