Capturing Message Id
All of our Send Message actions are processed asynchronously, preventing the action from providing a return value.
To handle this, the actions all emit a Platform Event that can be handled for storing the Id where you need it.
Set Intent to Publish Event
When sending a Notification to Teams, you'll have the option of Publish Event upon Notification.
- Toggle the option to Yes.
- Set an Id to be associated with this event. Usually a Record Id will work, but you can use any Id that will help you take the right action later.
- Provide a payload that can be used later. For simple cases a single word will be enough to differentiate between different events, but you could get fancy and send whatever you like (in text form, 32k characters)
- Save the changes to this Flow Element.
Now that the app is publishing events when your Notifications are being sent, we need to handle them.
Handling the Published Events
Platform Event Triggered Flows don't come with a filtering capability like Record Triggered Flows do, so you'll likely just have 1 Flow that handles all notification scenarios.
This is where the Additional Payload will help out, allowing you to take different actions as necessary.
To get Started, create a new Flow.
- Select Start From Scratch
- For the Type of Flow, select Platform Event - Triggered Flow
- For Platform Event, select Teams Bot Conversation Created
- Next, add a Decision Element. Use the Additional Payload field value to define your outcomes.
- Next, add an Update Records Element.
- Specify the Object type
- Use the Associated Id value to find the record (likely by Id)
- Stamp the Activity Id (this is the unique Id for the Message) into a Field of your choice on the Record.
Don't forget to Save & Activate the Flow when you are ready!