Programmatically point Power Query to a different SharePoint list

asecgeek

New Member
Joined
Apr 1, 2016
Messages
18
I have an Excel workbook that pulls data from several SharePoint lists on a Microsoft 365 tenant for ABC Company via Power Query.
I have the exact same SharePoint lists exist at XYZ Company's tenant.
I would like to have a button that programmatically switches the Power Query source from one tenant to the other.
I can manually change the Source and Navigation values by editing the settings in Power Query's Source and Navigation formulae, but I can't expect management to do that.
So, I would like to have a button that changes it. Example (with bogus values):

Source = = SharePoint.Tables("https://abc.sharepoint.com/sales/lists/", [Implementation=null, ApiVersion=15])
Navigation = = Source{[Id="67bdt8ed-7447-46w2-w2r2-gh247m74m867"]}[Items]

Source = = SharePoint.Tables("https://xyz.sharepoint.com/sales/crm/", [Implementation=null, ApiVersion=15])
Navigation = = Source{[Id="r9pse8wq-784m-58k4-iyr4-xd428wd55pq2"]}[Items]

Is it possible to modify these values with the click of a button?
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I looked into the link and I think it's pointing me in the right direction. Will report back with results.
 
Upvote 0
If you don't want people to go into the PQ UI, you can creatie a dropdown in Excel for the managers. Then PQ uses this single field table ( you name it SPvar or something in the name manager) to create a 'parameter'. In the source you refer to this query name where you have the SP address.
 
Upvote 0

Forum statistics

Threads
1,223,671
Messages
6,173,734
Members
452,529
Latest member
jpaxonreyes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top