Building an Approval experience in Canvas Apps
In a previous blog post, we used a custom connector to access a set of Common Data Services APIs to create a Business Process Flow component within Canvas app. Similarly, we can extend the Approvals connectors functionality by exposing additional operations via a custom connector. Specifically, we will use a set of APIs to list received and sent Approvals as well as approve and reject Approvals from within a Power Apps canvas app.
To retrieve sent and received approvals, we use the GetApprovals operation available in our custom connector:
To approve or reject an approval request, we use the SetApprovalResponse:
Custom Connector Deployment
Before creating the custom connector using the above swagger file, you will need to register an application with the Azure Active Directory service. For a refresher, read the following article here: https://docs.microsoft.com/azure/active-directory/azuread-dev/v1-oauth2-on-behalf-of-flow#register-the-application-and-service-in-azure-ad. While going through that process, grant permission for the flow service:
Ensure Approvals.Manage.All & Approvals.Read.All are checked.
Finally, download and import the swagger file for the custom connector. Enter Client Id, Client Secret and Resource URL: https://service.flow.microsoft.com/.
You can now import the app and give it at try !