Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

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: 


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




1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

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

     

    --Nate