pls try the following:
You need to pass parameters to identify the target screen and the specific item ID. https://apps.powerapps.com/play/{App ID}?tenantId={Tenant ID}&screen={Screen Name}&ItemID={ID}
New Item - https://apps.powerapps.com/play/{App ID}?tenantId={Tenant ID}&screen=FormScreen_New
Edit Item - https://apps.powerapps.com/play/{App ID}?tenantId={Tenant ID}&screen=Screen_Edit&ItemID=123
View Item - https://apps.powerapps.com/play/{App ID}?tenantId={Tenant ID}&screen=Screen_View&ItemID=123
In the app's OnStart
property, capture the parameters from the URL:
Set(ScreenParameter, Param("screen")); // Captures the screen name
Set(ItemIDParameter, Value(Param("ItemID"))); // Captures the item ID (if provided)
On each screen (FormScreen_New
, Screen_Edit
, Screen_View
), use the OnVisible
property to configure the form behavior:
New Screen (FormScreen_New
): - If(ScreenParameter = "FormScreen_New", NewForm(YourFormName));
Edit Screen (Screen_Edit
): If(
ScreenParameter = "Screen_Edit" && !IsBlank(ItemIDParameter),
EditForm(YourFormName);
YourFormName.Item = LookUp(YourDataSource, ID = ItemIDParameter)
);
View Screen (Screen_View
): If(
ScreenParameter = "Screen_View" && !IsBlank(ItemIDParameter),
ViewForm(YourFormName);
YourFormName.Item = LookUp(YourDataSource, ID = ItemIDParameter)
);
When generating approval notifications, include dynamic links with the appropriate parameters:
For New items - https://apps.powerapps.com/play/{App ID}?tenantId={Tenant ID}&screen=FormScreen_New
For Edit items - https://apps.powerapps.com/play/{App ID}?tenantId={Tenant ID}&screen=Screen_Edit&ItemID={ID}
For View items - https://apps.powerapps.com/play/{App ID}?tenantId={Tenant ID}&screen=Screen_View&ItemID={ID}
let me know if you need more details. thanks