The "Post PB Message from Webhook" workflow in Power Automate is designed to process incoming data from a webhook and post structured messages to a Microsoft Teams channel using adaptive cards. This workflow acts as a bridge between SAP and Teams
Importing
In Power Automate, navigate to 'My Flows' in the left hand menu.
At the top of the page, click on the 'Import' button. This will open the import screen where you can upload your workflow.
Select 'Import Package (Legacy)' and select the workflow package file (Post_PB_Message_From_Webhook.zip) from your local machine.
After the workflow is uploaded, you will see a list of resources in the package.
You will need to action the related resource and re-establish the connections. You will need to authenticate with the appropriate credentials for the services the workflow uses.
Once all resources are configured, click the 'Import' button at the bottom of the page.
Outbound workflow
The outbound workflow is designed to handle responses to adaptive cards within Microsoft Teams.
When a user interacts with an adaptive card, the workflow captures key information such as the message source system, message ID, user details, and the response provided. This data is then passed to a HTTP POST method, which facilitates the integration by sending the response back to SAP.
Importing a flow from a package file
For the outbound workflow, you can follow the same steps as for the inbound flow (above), but additional modifications will be necessary within the package content.
Select 'Import Package (Legacy)' and select the workflow package file (Handle_PB_Message_response.zip) from your local machine.
For the resource type flow select the Update or Action Spanner.
On the Import Setup, under the field Setup, select “Create as new” and give Resource name “Handle PB Message Response”.
You must configure the related resource and re-establish the connections, following the same process as the inbound workflow. Ensure you authenticate using the correct credentials for the services utilized by the workflow. If a connection is not available, select 'Create New' and add the required connection.
Amending Outbound Workflow
After importing the package file, locate the workflow. Select 'More Commands' and then select 'Edit'.
Review each step in the workflow to ensure accuracy.
{"source":"la-draft-clipboard","value":[{"tokenKey":"A425FA86-3499-4557-A388-052C538376C8","type":"token","token":{"source":"body","name":"entity.teamsFlowRunContext.channelData.team.aadGroupId","required":false,"value":"triggerBody()?['entity']?['teamsFlowRunContext']?['channelData']?['team']?['aadGroupId']","title":"Team ID","key":"body.$.rows.[*].entity.teamsFlowRunContext.channelData.team.aadGroupId","type":"string","isInsideArray":false,"parentArray":"rows","description":"The ID of the Team from which this activity is started","icon":"https://conn-afd-prod-endpoint-bmc9bqahasf3grgk.b01.azurefd.net/v1.0.1754/1.0.1754.4231/teams/icon.png","brandColor":"#474747"},"tokenExpression":"triggerBody()?['entity']?['teamsFlowRunContext']?['channelData']?['team']?['aadGroupId']"}]}
Channel
{"source":"la-draft-clipboard","value":[{"tokenKey":"A35F66DC-E7ED-4F91-B78B-66471A3AFFD3","type":"token","token":{"source":"body","name":"entity.teamsFlowRunContext.channelData.channel.id","required":false,"value":"triggerBody()?['entity']?['teamsFlowRunContext']?['channelData']?['channel']?['id']","title":"Channel ID","key":"body.$.rows.[*].entity.teamsFlowRunContext.channelData.channel.id","type":"string","isInsideArray":false,"parentArray":"rows","description":"The channel ID for this activity","icon":"https://conn-afd-prod-endpoint-bmc9bqahasf3grgk.b01.azurefd.net/v1.0.1754/1.0.1754.4231/teams/icon.png","brandColor":"#474747"},"tokenExpression":"triggerBody()?['entity']?['teamsFlowRunContext']?['channelData']?['channel']?['id']"}]}