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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Add API result to each row when adding a column using Invoke function

hello

 

I am trying to Invoke a function that is pulling data from an API. The function takes IDs from the table where I am adding the column.

 

Here is my function 

 

 

let
    Source =(ID_1, ID_2 as text) => let
           Source = each Json.Document(Web.Contents("https://fake.api.com/v3/rest/fake1/" & ID_1 & "/fake2/" & ID_2 & "/fake3?limit=1&offset=0" , [Headers=[Authorization= "Bearer myapikey"]])),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
    in      
    #"Converted to Table"
in
    Source

 

the table is like this

ID_1ID_2
6e9e7742-d651-44f6-b2a1-6d1edcd94ace17e61aba-19f1-49d6-a07c-aa0085b38b5f
c89f89b2-bfd6-4984-b672-ad3f20a1fb8ca4f06500-2a2a-4318-a9ab-bfeae705e7d3

 

I get this error message when invoking the function 

Expression.Error: We cannot convert a value of type Function to type List.
Details:
Value=[Function]

 

Thanks

Joe
Type=[Type]

1 ACCEPTED SOLUTION
Anonymous
Not applicable

By removing the "each" before  Json.Document helped it work 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

By removing the "each" before  Json.Document helped it work 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.