Combine Power Automate, Microsoft Teams Approvals ...
Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
Right now, I'm involved in a Side-by-Side Extension Product development. The application is implemented using the SAP Cloud Application Programming Model (CAP) using the NodeJS runtime. The documents maintained in the application need to be approved by a second person (approver) after a specific step. To provide the approver a seamless experience I see these options:
Integrate into the SAP S/4HANA on Premise "My Inbox" app
Integrate into SAP Task Center service
Integrate into Microsoft Outlook
Integrate into Microsoft Teams
Send a mail
The first option to integrate into the "My Inbox" app requires the implementation of a custom task provider class as nicely described by harish.vyas in his post Integrating 3rd Party Workflow to Fiori My Inbox.
While composing this post I've re-discovered the blog post Integrating SAP Cloud Platform Workflow with Microsoft Outlook by harald.schubert. It describes in great detail how to leverage Adaptive Cards for SAP Workflow service approvals in Outlook.
During my research I've found the app Approvals in Microsoft Teams. From there the solution was just a link away: Microsoft Teams approvals with custom connectors. It seems to be possible to trigger a new approval from a Power Automate Flow and send the approval result back via a custom connector. That's the Architecture I've came up with:
As the bookshop-demo application already is setup for API access it was quite easy to setup security using authentication type "OAuth 2.0" with Identity Provider "Generic Oauth 2":
You find the needed Client ID and Client Secret in the credentials when you've followed my description in API access. The authorizationUrl and tokenUrl end up in the Swagger definition:
For the connector I've defined several actions. Here you see the one for the approval. The action provides the parameters that can be filled in the flow:
After establishing the connection, I started to create this flow:
For the final result please check out this demo video:
Final thoughts
The setup was straight forward. I would think that with a combination of mraepple#content:blogposts from mraepple it should be possible to achieve even SSO from Microsoft Teams to the CAP App. Right now, other users use the connection that I've established. So I will be the user stored in the change history. For this scenario I would prefer the OAuth2 Client Credentials Flow. But that is not yet supported. You can vote at Add support for OAuth2 Client Credentials auth flow in Custom Connectors Security for it.
This is the result when searching for SAP connectors: