
Announcements
We are creating a custom page with a PCF control embedded in the page. This PCF control has a table on it, and we want the user to be able to navigate to another custom page by clicking on a row in the table. However, at the moment we have not found a way to implement the redirect. Does anyone know how to achieve this redirect?
Below image as a table on the PCF
Hi @KateExcellet ,
I guess you could try to use context.navigation.navigateTo and navigate to another Custom Page (even if not specified in the docs, navigateTo works).
Another approach would be to implement only the row selection inside the PCF using setSelectedRecordIds (https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/dataset/setselectedrecordids?WT.mc_id=BA-MVP-5004107).
Then your dataset PCF can trigger an event (I think it's the onChange, not sure if it works with OnSelect event) where you can use PowerFx to navigate to the selected record (which you can get using your PCF control.Selected).
T4he docs on PowerFx navigation to another Custom Page by passing a record: https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/page-powerfx-in-model-app?WT.mc_id=BA-MVP-5004107#navigate-to-a-specific-custom-page-with-a-record-input
So the Navigate command could look like
Navigate(
YourPCF.Selected,
{ Page: 'YouRedirectCustomPage' }
)
The only problem you could have with PowerFx navigation: in case your Custom Page with the PCF is opened in a dialog. Then the Navigate could close the dialog and open the redirected page in the main window (not sure if it still behaves like this). Then the PCF navigateTo could perform better. But I didn't tried it out.
Hope this helps!