Best Practices: Using the Send Immediate option in the Notification Element
Centro provides the option to Send Immediately in the Send Notification to Slack Flow element in Salesforce. The main advantage of using the option is to immediately return the Slack Message Timestamp within the Salesforce Flow. We return the exact Message Queue record with fields filled in for use within the flow That way, without doing a lookup in a different Flow, you may leverage this Slack Message Timestamp for posting additional threaded messages to Slack, saving the Timestamp to a specific Salesforce record, using it to notify in other methods like the Salesforce bell, and more.
First, it is important to understand the limitations of this element options. When enabled, it can only be used once per Flow path. You may not use it more than once in any given path, however, you may have multiple Send Notifications in the same path, just not with the Send Immediate option turned on.
Additionally, you must use the notification option type before any Salesforce DML operations such as Create, Update, or Delete options. That is, it must be used in the Flow sequence before any other DML in any given path.
With that in mind, let's set up the following use case: We want to notify a user that a case has been created, and save the Message Timestamp value to the Case record so that it can be previewed with a Single Channel Conversation in Salesforce.
- Add the Send Notification element and complete as you see fit. Under Message Options, choose "Send Immediate":
- Now, you'll notice that you have a new "Outputs from <Label of Send Notification element>" available to you in the Flow:
(Note that you have to drill into MessageQueue, and then see the fields available to you:
- Note that all of the fields on the Message Queue object are now available for you in the Flow. In this case, we'll need the MessageTS and Channel ID, but there are other useful fields likely for your use case:
- Now we can Update the Case with the message Timestamp field:
- We can now see the results both in Slack and Salesforce:
That's it! Let us know if you have any questions in your Slack Connect channel with us or firstname.lastname@example.org