Forum Discussion
Microsoft Teams tab using SharePoint Framework always interact with SharePoint Online root site
Please try the following, you can change the destination of the list from the root site to another site. The Lists app in Teams is based on SharePoint and Lists data is stored in the SharePoint Online team site.
To change the destination of the list, you would need to modify the SharePoint Framework (SPFx) web part code to point to the desired SharePoint site. This can be done by changing the site URL in the code where you are creating or accessing the list.
Here's a basic example of how you might access a list on a different site using the SharePoint Framework:
let web = new Web("https://YOUR_TENANT_NAME.sharepoint.com/sites/YOUR_SITE_NAME");
let list = web.lists.getByTitle("Your List Name");
In this example, replace "https://YOUR_TENANT_NAME.sharepoint.com/sites/YOUR_SITE_NAME"
with the URL of the site where you want the list to be created, and replace "Your List Name"
with the name of your list.
Please note that the user must have the necessary permissions to create or access lists on the specified site.
For more information on data residency for SharePoint Online and OneDrive for Business, you can refer to this link: Data Residency for SharePoint Online and OneDrive for Business.
Also, for more details on how to use the SharePoint Framework in Teams, you can refer to this link: How to use the SharePoint Framework in Teams.
- Meghana-MSFTNov 07, 2023Bronze ContributorUnfortunately, this is not possible.