Forum Discussion
Teams SHAREPOINT type Tabs - Power Automate - JSON Payloads - Solution & Question
Greetings,
I intent to use this post to:
- – Pass along a solution I have recently put together
- – See if anyone can help make the solution a bit more efficient
The solution is designed to:
- – Add tabs to an already existing Team
- – Specifically: Sharepoint type tabs, hosting modern Site Pages [NOT: a Website, Document Library or SharePoint Pages tab]
- – Using Power Automate & JSON payloads
The issue/inefficiency I am hoping to solve:
- – The current solution is designed to add more than 1 Sharepoint-type tab to a Team
- – Currently, within my Power Automate flow, in order to create (3) Sharepoint Tabs, I have to use (3) HTTP calls & (3) separate JSON payloads.
- – Basically: Anyone know how to write a singular JSON payload for 1+ Tabs?
In my research, in the English speaking corners of the internet, I only discovered a single blog that attempted to cover adding Sharepoint Tabs, while also the issues involved with the Website type tab. It should also be noted that Microsoft own documentation for this type of tab claims to be ‘unconfigurable’… this is not true.
Ref 1: https://mymetaverseday.com/2021/11/24/spgraph/
Ref 2: https://mymetaverseday.com/2019/09/24/adding-a-sharepoint-page-or-list-as-tab-to-teams-using-graph-api/
The blog is the only source to point out the encoding that is necessary in the “third section” of the ContentURL component.
This is first KEY to add Sharepoint Tabs using JSON and Power Automate. [Note: Section 1, Section 2, Section 3 (encoded)]
The second KEY, which I have yet to find discussed elsewhere, are the proper payloads for the ‘email address removed for privacy reasons’ & ‘teamsAppId’ components. [Note: Green Font]
The basic payload is such:
[IMPORTANT NOTE: There is a ' ' (space) between 'teamsApp' & '@odata.bind' (The forum was treating it as an email address]
{
"displayName": "Field Users Home",
mailto:email address removed for privacy reasons: "https://graph.microsoft.com/beta/appCatalogs/teamsApps/2a527703-1f6f-4559-a332-d8a7d288cd88",
"teamsAppId": "2a527703-1f6f-4559-a332-d8a7d288cd88",
"configuration": {
"contentUrl": https://tenantname.sharepoint.com/sites/Projects/TRR_Teams_Tabs_Flow_Test/_layouts/15/teamslogon.aspx?spfx=true&dest=https%3A%2F%2Ftenantname.sharepoint.com%2Fsites%2FProjects%2FTRR_Teams_Tabs_Flow_Test%2FSitePages%2FFieldUsersHome.aspx_layouts/15/teamslogon.aspx?spfx=true&dest=https%3A%2F%2Ftenantname.sharepoint.com%2Fsites%2FProjects%2FTRR_Teams_Tabs_Flow_Test%2FSitePages%2FFieldUsersHome.aspx,
"websiteUrl": https://tenantname.sharepoint.com/sites/Projects/TRR_Teams_Tabs_Flow_Test/SitePages/FieldUsersHome.aspx,
"removeUrl": ""
}
}
Overview of a Power Automate flow, with only 1 payload
Power Automate HTTP Step for the JSON Payload
---------------------------------------------------------------------
Where I need help...
---------------------------------------------------------------------
How can these 3 payloads be rewritten into a single payload?!
{
"displayName": "Field Users Home",
"teamsApp @odata.bind": " https://graph.microsoft.com/beta/appCatalogs/teamsApps/2a527703-1f6f-4559-a332-d8a7d288cd88",
"teamsAppId": "2a527703-1f6f-4559-a332-d8a7d288cd88",
"configuration": {
"contentUrl": "https://tenantname.sharepoint.com/sites/Projects/TEMPLATE December 2022/_layouts/15/teamslogon.aspx?spfx=true&dest=https%3A%2F%2Ftenantname.sharepoint.com%2Fsites%2FProjects%2FTEMPLATE%20December%202022%2FSitePages%2FFieldUsersHome.aspx",
"websiteUrl": "https://tenantname.sharepoint.com/sites/Projects/TEMPLATE December 2022/SitePages/FieldUsersHome.aspx",
"removeUrl": ""
}
}
{
"displayName": "Project Home Page",
"teamsApp @odata.bind": " https://graph.microsoft.com/beta/appCatalogs/teamsApps/2a527703-1f6f-4559-a332-d8a7d288cd88",
"teamsAppId": "2a527703-1f6f-4559-a332-d8a7d288cd88",
"configuration": {
"contentUrl": "https://tenantname.sharepoint.com/sites/Projects/TEMPLATE December 2022/_layouts/15/teamslogon.aspx?spfx=true&dest=https%3A%2F%2Ftenantname.sharepoint.com%2Fsites%2FProjects%2FTEMPLATE%20December%202022%2FSitePages%2FRoot.aspx",
"websiteUrl": "https://tenantname.sharepoint.com/sites/Projects/TEMPLATE December 2022/SitePages/Root.aspx",
"removeUrl": ""
}
}
{
"displayName": "Focused Libraries",
"teamsApp @odata.bind": "https://graph.microsoft.com/beta/appCatalogs/teamsApps/2a527703-1f6f-4559-a332-d8a7d288cd88",
"teamsAppId": "2a527703-1f6f-4559-a332-d8a7d288cd88",
"configuration": {
"contentUrl": "https://tenantname.sharepoint.com/sites/Projects/TEMPLATE December 2022/_layouts/15/teamslogon.aspx?spfx=true&dest=https%3A%2F%2Ftenantname.sharepoint.com%2Fsites%2FProjects%2FTEMPLATE%20December%202022%2FSitePages%2FDocLibNav.aspx",
"websiteUrl": "https://tenantname.sharepoint.com/sites/Projects/TEMPLATE December 2022/SitePages/DocLibNav.aspx",
"removeUrl": ""
}
}
-------------------------------------------------
-------------------------------------------------
Much appreciated,
-TR
1 Reply
- PWA_ServiceCopper Contributor
Since the forum's formatting of the code payloads isn't necessarily ideal, here are 2 more screenshots for clarity.
First screenshot - the basic payload, with the 3 sections of the ContentURL component highlighted
Second screenshot - all 3 payloads