List Message Replies
Retrieve the replies from a Message with this action to bring the threaded details into Salesforce. Messages can be used as-is, or provided to an LLM for further processing.
Permissions Required
Permission | Description |
Manage Flow | To create the Flow |
Teams Designer (Perm Set) | To work with this package's Flow Actions. |
From your Flow, we will start by adding a new Element.
- Search for List Messages, select MS Teams - List Message Replies
- Give the new Flow element a Label, allow the API Name to auto populate
- (optional) Provide a description to help you remember the intent of this Action
- Search for the Channel (or provide it in manual mode) that has the Message.
- Provide the Message Id of the Channel's message you want to retrieve replies from.
Note: If you are working with a Template-Triggered Prompt Flow, you won't be able to select from $Input. As a result, please use a Formula variable to pull the value in.
Working with Replies
You have the choice on how the replies are provided to Flow.
- Individual Apex-Defined Variables: Great for more advanced logic
- Concatenated into Single Text Variable: Great for passing into a Generative AI prompt.
First, lets cover the single text variable. In this format, each message is appended to the last with the sender's Name, Timestamp and message. In this scenario, be sure to use the messagesText output variable from the Action.
If you are working with Individual Variables, you can use a Flow Loop and gain access to each piece individually. In this scenario, be sure to use the messages output variable from the Action.
Only one of the 2 output variables will be populated, based on the Toggle you set during the Action creation.
In this example, our Flow retrieves the messages (using the ID captured when the message was sent) and then iterates through them looking for one we can take action on.
Within each message, the following attributes are available:
- timestamp: when the reply was sent.
- displayName: the name of the person that sent the reply
- id: the Id of the reply within MS Teams
- message: the content of the message included in the reply