The broader use case of a Salesforce chatter API is to Integrate a third-party web application with Salesforce so it can notify groups of users about events. The 'Post Feed To Chatter Group By Group Id' Block is completely catered to post feed to a particular group. In this article, you can find the same use case is built using the 'Post Feed Item' Block.
Here, we are alerting a particular Group of users in Salesforce when a 'Do Reload' responds with a 'FAILED' status.
- Use a condition block to filter out the 'FAILED' status from the 'Do Reload' block.
- Next, we'll list out all the 'Collaboration Groups' present in the Salesforce instance and cache them.
- Save the ID of the appropriate group to which the alerting message should be sent using a variable block.
- Use variable blocks to construct the appropriate 'Body' of the message as per each message body definition (More info here). Using multiple variable blocks of appropriate types help us to construct required JSON bodies. (Refer to this page to know more on how to construct JSON object or List on the go in an Automation)
- Map the saved ID to the 'Subject Id', constructed message bodies to the 'Body' and 'Capabilities' fields (as raw input) of the 'Post Feed Item' block.
-
We have built the final message body based on the Failed log of the 'Do Reload' block.
