PowerApps is the only recommended solution if you want to customize SharePoint list forms. If you have a situation with the below requirements, how will you achieve it?
How can you achieve this with just one native PowerApps app? This will help to develop your UI customization only once. Let’s see this in today’s article.
Using customized forms might resolve the second requirement but the first and third won’t be fulfilled with this.
We can create a native PowerApps app to fulfill all the above three requirements. Let’s see how.
Decide what parameters/information you want to send from other applications to your App. In my scenario, I had to provide a link to the PowerApps app in the CRM application. I had to send SaleID as a parameter. My App was used to create/manage some approval process for a Sales record.
So, with parameter name and value this is how the URL looks:
https://web.powerapps.com/webplayer/app?appId=/providers/Microsoft.PowerApps/apps/<app_id>&SaleID=1234
How to open a native app from the SharePoint list view?
This is a tricky part. I have used customized forms to navigate to Native PowerApps. So whenever the user clicks on a list item or tries to edit the item from SharePoint list view >> we will redirect the user to PowerApps native app.
We need to customize the list forms in SharePoint. Handle the events of OnView, OnEdit to open PowerApps app.
We will use the Launch function. Specify the same URL as above.
Go to SharePoint List >> select Customize Forms option. It will create a form with default controls. Select the "SharePointIntegration" control as shown below.
There are predefined events on this control >> OnView, OnEdit etc. >> we will write Launch function with our native App URL >> So that whenever a user opens or edits items we will redirect the user to our native App. Check the below screen:
Similarly, we will handle the OnEdit event too. You can use RequestHide() function hide the forms on allitems.aspx page.
How does this app work on mobile devices?
In my scenario, I had to inform business users about the request over email so that they can open it, review it and act on it. In today's world, everyone uses mobile devices more than desktop. We can send the same URL as above in the mail body. So, when a user clicks on the link, it will prompt for the first time to choose an app (browser or PowerApps) >> and the user should open the request with the PowerApps app.
I hope this helps in some way.