Setting Up Custom Notifications and Flows
We recommend that you set up custom notifications and flows, to enable users to receive notifications for the following scenarios:
- When a user is assigned as the Playbook Owner of a playbook.
- When a user is assigned to a playbook task.
Here is an example of creating a custom notification and flow to alert the user they have been assigned as the playbook owner. You can use this example and adapt it to fit your specific requirements.
- In Setup, click Notification Builder | Custom Notifications.
- In the Custom Notification Types section, click New.
- Enter a name for your notification. For example, Playbook Owner Notification. The API name auto-populates.
- Select the appropriate supported channel options.
- Click Save.
Example Flow: Send Notification When the Playbook Owner Is Updated
- In setup, navigate to Process Automation | Flows. Then, click New Flow.
- Select “Record-Triggered Flow”, then click Create.
- In the Configure Start window, select the following values from the fields displayed:
- Object: “Playbook”
- Configure Trigger: “A record is updated”
- In the Set Entry Conditions section, set the condition requirements to “All Conditions Are Met (AND)”, and select the following values:
- Field: “csc__Playbook_Owner__c”
- Operator: “Is Changed”
- Value: “True”
- Ensure that “Every time a record is updated and meets the condition requirements” is selected for when to run and update the records.
- Ensure “Actions and Related Records” is selected in the flow optimization section.
- Click Done.
- In Flow Builder, open the Toolbox and click New Resource.
- In the New Resource window, select or enter the following values in the fields displayed:
- Resource Type: “Variable”
- API Name: Enter a name, for example, RecipientId.
- Data Type “Text”
- Select the “Allow multiple values (collection)” checkbox.
- Click Done.
- Next, click New Resource from the Toolbox panel.
- In the New Resource window, select or enter the following values in the fields displayed:
- Resource Type: “Formula”
- API Name: Enter a name, for example, notificationBody.
- Data Type “Text”
- In the Formula box, enter the following formula: You have been assigned to ‘ + {!$Record.Name}
- Click Done.
- Move your cursor to the circle in the center of the flow graphic, and click the Add Element button.
- Select “Assignment” from the list.
- In the New Assignment window, give the new assignment a label. For example, Assign RecipientId. The API Name field auto-populates.
- In the Set Variable Values section select the following values:
- Variable: Select the variable you created earlier, for example, “RecipientId”
- Operator: “Add”
- Value: “$Record - csc__Playbook__c”, “Playbook Owner - Playbook Owner”, “csc__Salesforce_User__r - Salesforce User”, and “Id - User ID”.
- Click Done.
- Add the Get Records element between the Assignment and End nodes.
- In the New Get Records window, enter a label. For example, Get Custom Notification. The API Name field auto-populates.
- In the Get Records of This Object section, select “Custom Notification Type” from the Object list.
- In the Filter Custom Notification Type Records section, select the following values:
- Condition Requirements: “All Conditions Are Met (AND)”
- Field: “DeveloperName”
- Operator: “Equals”
- Value: This value is the API name of the custom notification you created earlier. For example, “Playbook_Owner_Notification”.
- Click Done.
- Add the Action element between the Get Records and End nodes.
- Search and select the “Send Custom Notification” from the Action field.
- Enter a label. For example, Send Notification. The API Name field auto-populates.
- In the Set Input Values for the Selected Action section, select the following values:
- Custom Notification Type ID: This is referring to the label you created previously, for example, “Custom Notification Type from Get_Custom_Notification” and “Id”.
- Notification Body: This relates to the label we defined previously. For example, “NotificationBody”.
- Notification Title: Define the title for your notification. For example, New Assignment. Alternatively, you could set up a variable for this.
- Recipient IDs: This relates to the label we defined previously. For example, “RecipientId”
- Target ID: Set to “Include”, then enter $Record - csc__Playbook__c and Id - Record ID.
- Click Done.
- Click Save. The Save the flow window opens.
- Enter a name for your flow in the Flow Label field. For example, Playbook Assignment Notification Flow. The
- API name auto populates.
- Click Save.
- Click Activate to activate your flow.
When the playbook owner is updated, the new owner receives a notification.