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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
lcunha
Regular Visitor

Expression.Error We cannot convert the value List to type Text

Hi, I'm having trouble with this code right here:

 

 

let
    base_URL = "https://<company>.pipedrive.com/api/v1/deals/",
    Fonte = pip_Deals_IDs,
    pipedrive_table = "/products",
    admin_token = "<admin_token>",
    admin_token_URL = Text.Combine({"?api_token=",admin_token}),
    call_deal_products = Table.AddColumn(Fonte, "deal products",
    each let
        deal_id = Fonte[deal id],
        call_API = Text.Combine({base_URL,deal_id,pipedrive_table,admin_token_URL})
    in
        Json.Document(
        Web.Contents(call_API)
        ), 
    List.Type
    )
in

call_deal_products

 

The Query is returning an Expression.Error: 

 

Error 01.png

 

lcunha_0-1635783048814.png

 

 

Testing for one ID, the return should be like this:

 

 

let
    base_URL = "https://<company>.pipedrive.com/api/v1/deals/",
    Fonte = pip_Deals_IDs,
    deal_id = "1050",
    pipedrive_table = "/products",
    admin_token = "<admin_token>",
    admin_token_URL = Text.Combine({"?api_token=",admin_token}),
    call_API = Text.Combine({base_URL,deal_id,pipedrive_table,admin_token_URL}),
    call_deal_products = Json.Document(Web.Contents(call_API))
in

call_deal_products

 

 

lcunha_1-1635783331578.png

 

The data that I'm trying to return is inside this list in the row called "data".

 

What am I getting wrong?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lcunha 

 

This line, it is a list

deal_id = Fonte[deal id],

you can do 

deal_id = [deal id],

 or make sure it is text

deal_id = Text.From([deal id]),

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @lcunha 

 

This line, it is a list

deal_id = Fonte[deal id],

you can do 

deal_id = [deal id],

 or make sure it is text

deal_id = Text.From([deal id]),

Helpful resources

Announcements
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.