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:
Great stuff, Gregor! This is the out-of-the-box thinking who is helping to see the opportunities in the cloud. At the end it's just REST-(wonder-) full.
I am also having the challenge how to explain the customer why they will need 2 different inboxes on S/4 right now .. so this could be another useful approach!
A very good example of integrating multiple technologies. If I have understand correctly, you are implementing a side-by-side extension for S/4HANA on-premise. During workflow discussions I've had, it comes up that the best practice is to use the workflow engine of the core system (eg. S/4HANA) so that there is a single, consistent workflow hub that can be accessed by multiple channels. Indeed, even the Microsoft Teams approvals with custom connectors reference states "You can use the approvals hub in Microsoft Teams to quickly integrate approvals workflows into existing line of business apps that do not have their own approvals system". What are your thoughts about this?
Also, since your extension is deployed on BTP, what about using the BTP Workflow Service?
For your scenario, assuming that with S/4HANA you already have the Fiori My Inbox app implemented, why is there a need to develop another inbox instead of integrating the new workflow with the existing My Inbox?
it is about S/4 HANA Public Cloud and there we do not have the chance to add custom made workflows within the S/4-My Inbox.
SAP was announcing back in 2019 something called "One Inbox" or "Central Inbox" - unfortunately I do not know what the progress is about. The idea was to provide a central place for all workitems within the hole landscape.
In my case, this resolved into 2 different "My Inbox" apps on the S/4 FLP.
thank you for your feedback. Have you read through the section "Context and possible options"? I've checked the option to use the S/4HANA My Inbox. But if you know about about another option then implementing the custom feeder class I'm open for ideas. Is there maybe a way to create a generic workflow with just a link to our Side-by-Side extension via an released API?
You use a customer connector to connect from Power Automate to SAP. What is the benefit of using a customer connector ? As using the Power Automate HTTP connector would also be possible and prevents developing a customer connector.
Thanks, that clarifies. We do use a similar Power Automate invoice approve scenario where we exchange invoice and invoice release by IDOC. Where the IDOC's are exchanged by HTTP and the standard Power Automate HTTP connector. In that scenario a single SAP service user is being used. So when user propagation is required a customer connector might be required.
After went through the blog and bookstore demo app source code, I have one question regarding the Power Automator trigger would like to double check with you.
If I'm understand correct, we have to define the trigger inside of the custom connector in the Power Automator, and then we could build the flow on top of this trigger.
When I try to define the trigger in the custom connector it asks me to provide an API endpoint, request payload to define the webhook. In your screenshot I'm seeing that you provided Azure logic apps endpoint, may I know does this means that the SAP CAP app will send the request to Azure logic apps after user create the new approval record in the Fiori frontend app?
Also in the bookstore demo app source code, we will send an HTTPS request after user create the approval record through the destination, does this destination also pointing to the same Azure Logic Apps endpoint ?
Best Regard,
Weikun Liu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.