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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register 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
Vera_33
Resident Rockstar
Resident Rockstar

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
Vera_33
Resident Rockstar
Resident Rockstar

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 Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors