Forum Discussion

Laho's avatar
Laho
Helper I
7 years ago
Solved

Expression.Error: We cannot convert the value {x} to type Text.

Hi,   I have 1 column with id and want to add an extra column webrequest based on that id(parameter). Stuck on the "Expression.Error: We cannot convert the value 5 to type Text.".   Usually you ...
  • Laho's avatar
    Laho
    7 years ago

    Was indeed some data that cannot be parsed, but not specifically (only) the id column. Updated the following:

     

      DynamicAPICallColumn = (id) =>
    
                let 
    
                    Response = Json.Document(
                        Web.Contents("https://api.pipedrive.com/v1/deals/",
                            [RelativePath= "" & Number.ToText(id) & "/products",
                            Query=[start="0", include_product_data="0", api_token="xxxx"]]
                        )
                    ),
                    Data = Response[data]
                
                in
    
        Data,
      #"Added Custom1" = Table.AddColumn(#"Removed Errors", "APICall", each DynamicAPICallColumn([id])),

    Works like a charm now. Thanks