Forum Discussion
Append several SharePoint list sources. How to do it in M?
Hello everyone!
I want to merge several SharePoint lists (around 100), with the same column names, but with different names and in different sites.
I already tried to bring all tables and then append, but would be terrible to do it in a hundred sources. Is there a easier way to get these data in a single M Code?
Yes you can, I wrote a blog article on this once. Basically all you have to do is something like:
let
Source = ...
Source1 = ...
Source2 = ...
Final = Table.Combine({Source, Source1, Source2})
in
Final
4 Replies
- Greg_Deckler
Community Champion
Yes you can, I wrote a blog article on this once. Basically all you have to do is something like:
let
Source = ...
Source1 = ...
Source2 = ...
Final = Table.Combine({Source, Source1, Source2})
in
Final
- AnonymousNot applicable
Thanks,
Is it possible to do like a For function? Because I have a list of links in SP and now I realized we have 620 SP lists and this number increases +120 yearly.
let
Source = List_of_SP_List_Links
For each List_of_SP_List_Links
do Final = Table.Combine({Final, SharePoint.Tables(List_of_SP_List_Links)})
next
in
Final
- danextian
Super User
Hi Anonymous ,
If you have a list of SP links, you can import that as a table and add a custom column like this one:
= SharePoint.Tables([URL Column], [ApiVersion = 15])And work from t here.
- ElizabethTachji
Helper III
Hi Greg,
Thank you for code. amazing. How do I get a source sublist name for each row?