Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi All,
I am trying to loop through my first collum to fill every row in an OData link. see code below:
let
Source = [id],
ProcessItem = (item) =>
let
ODataLink = "https://api.api.com/api/example/" & Text.From(item) & "/value",
Result = OData.Feed(ODataLink)
in
Result,
Results = List.Transform(Source, each ProcessItem(_))
in
Results
However my code brings the following error: Expression.error: Can't convert value "1234567" to type list.
My function is returning text so why does List.Transform give me this error?
If anyone has suggestions please let me know, thanks in advance!
Hi, @nbn88
Based on your description, you can try this.
let
YourTableName = YourActualTableName, // Replace with your actual table name
Source = Table.Column(YourTableName, "id"),
ProcessItem = (item) =>
let
ODataLink = "https://api.api.com/api/example/" & Text.From(item) & "/value",
Result = OData.Feed(ODataLink)
in
Result,
Results = List.Transform(Source, each ProcessItem(_))
in
Results
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
This query gives me the error: UnexpectedXmlElement : The schema element 'NavigationProperty' was not expected in the given context. When i manually enter the query with a fixed value it does work. So there must be something with formatting the value?
pls try this
Source = {[id]}, // convert to list
ProcessItem = (item) =>
let
ODataLink = "https://api.api.com/api/example/" & Text.From(item) & "/value",
Result = OData.Feed(ODataLink)
in
Result,
Results = List.Transform(Source, each ProcessItem(_))
in
Results
Thanks for your suggestion, however i now get the following error: The metadata document could not be read from the message content
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
78 | |
59 | |
36 | |
33 |
User | Count |
---|---|
94 | |
61 | |
56 | |
49 | |
41 |