
Announcements
I'm trying to set up a flow to export a pdf from Power BI and upload the file to a teams group.
After the file is uploaded, I would like to create a tab in the channel of the group linking to the pdf file.
Is there a way for me to retrieve the EntityId and ContentUrl dynamically from the file I just created?
Hi @andycylin,
Not sure if the Send a Microsoft Graph HTTP request action actually allows the creation of tabs, since that is a 3rd segment type of action. That action only allows 2 segments.
Construct a Microsoft Graph REST API request to invoke against the Microsoft Team endpoints. These segments are supported: 1st segment: /teams, /me, /users 2nd segment: channels, chats, installedApps, messages, pinnedMessages.
Reference to the doc: https://learn.microsoft.com/en-us/connectors/teams/?tabs=text1#actions
For the payload you should be able to use the uniqueId of the file, the site collection address and the path properties. Below is example in a HTTP action.
1. The uniqueId value is retrieved via a separate HTTP request. That approach can also be found on my blog:
https://www.expiscornovus.com/2023/05/04/get-uniqueid-of-file/
_api/web/lists/getbytitle('TestLibrary')/items(@{outputs('Create_file')?['body/ItemId']})/FieldValuesAsText?$select=UniqueId
2. The payload used in the HTTP request is the below. It uses expression referring to the Create File and Send an HTTP request to SharePoint actions.
{
"displayName": "@{outputs('Create_file')?['body/Name']}",
"teamsApp@odata.bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/com.microsoft.teamspace.tab.file.staticviewer.pdf",
"configuration": {
"entityId": "@{outputs('Send_an_HTTP_request_to_SharePoint')?['body']['uniqueId']}",
"contentUrl": "@{actions('Create_file')['inputs']['parameters']['dataset']}@{outputs('Create_file')?['body/Path']}",
"websiteUrl": null,
"removeUrl": null
}
}