Forum Discussion
Dynamically query multiple OData Feeds
- 6 years ago
you can create a function in M that takes the PlanId as a parameter and does the fetching. or just concatenate the string.
Table.AddColumn("x","y", each OData.Feed(urla & [PlanId] & urlb) )
etc.
you can create a function in M that takes the PlanId as a parameter and does the fetching. or just concatenate the string.
Table.AddColumn("x","y", each OData.Feed(urla & [PlanId] & urlb) )
etc.
I tried adding a column and it worked but listed as Table. When I try to expand the table I get the error "Column 'id' in Table 'New GTAC Plans' contains a duplicate value '{APlanID}' and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table"
let
Source = OData.Feed("https://graph.microsoft.com/v1.0//groups/{GroupIDRemoved}/planner/plans", null, [Implementation="2.0"]),
#"Removed Columns" = Table.RemoveColumns(Source,{"tasks", "buckets", "details"}),
#"Added Custom" = Table.AddColumn(#"Removed Columns", "Tasks", each OData.Feed("https://graph.microsoft.com/v1.0/planner/plans/" &[id]&"/tasks", null, [Implementation="2.0"])),
#"Removed Columns1" = Table.RemoveColumns(#"Added Custom",{"createdBy", "createdDateTime", "owner"}),
#"Expanded Tasks" = Table.ExpandTableColumn(#"Removed Columns1", "Tasks", {"id", "title", "startDateTime", "createdDateTime", "dueDateTime"}, {"Tasks.id", "Tasks.title", "Tasks.startDateTime", "Tasks.createdDateTime", "Tasks.dueDateTime"})
in
#"Expanded Tasks"