I'm working on a Power Apps Code App embedded in a Microsoft Teams tab, and Iām trying to pass parameters from a Power Automate flow using Microsoft Graph sendActivityNotification.
ā
Scenario
ā¢Teams custom tab app hosting a Power Apps code app
ā¢Sending notification using Power Automate ā HTTP ā Graph API
ā¢Using topic.webUrl to open the app via Teams deep link
ā
What Iām trying to achieve
Pass a parameter (e.g. record ID or navigation key) from the notification so that when the user clicks it:
ā¢Teams opens the tab
ā¢Power Apps code app receives the parameter
ā¢App navigates to the correct screen/item
ā
What I implemented
Deep link used inside topic.webUrl:
https://teams.microsoft.com/l/entity/<APP_ID>/<PAGE_ID>?tenantId=<TENANT_ID>&context=%7B%22subEntityId%22%3A%22linereports%22%7D
Inside the Power Apps code app:
import { getContext } from "@microsoft/power-apps/app";
const ctx = await getContext();
console.log(ctx.app.queryParams);
ā Issue
ctx.app.queryParams only contains:
{
"hidenavbar": "true",
"tenantId": "..."
}
👉 Custom parameter (linereports) is not available
ā
Additional attempts
ā¢Tried using TeamsJS:
import { app } from "@microsoft/teams-js";
await app.initialize(); // fails with timeout
Error:
SDK initialization timed out (Ocdi)
ā
Questions
1.Is it possible to access subEntityId (or subPageId) inside a Power Apps code app?
2.Is there a supported way to pass parameters from Teams deep link into a Power Apps code app?
3.Do we need to configure the Teams tab content URL placeholders (e.g. {page.subPageId}) for this to work?
4.Is TeamsJS unsupported inside Power Apps code apps because of the nested iframe?
ā
Expected outcome
Ideally I want:
ctx.app.queryParams.itemId === "linereports"
ā
Any guidance appreciated!
If anyone has implemented this with:
ā¢Power Apps Code Apps
ā¢Teams tab deep linking
ā¢Activity feed notifications