Creating Custom Modes of Notification with Notification FlowsLast Updated: 07/11/2018 Introduced in Version: 2.0
A user can create a special kind of flow, called a Notification flow. This flow can be configured like any other flow, but has one special feature. After a notification flow has been saved, it is available to be used as a notification mode. Such as email, popup or SMS message, when creating a notification. A notification flow gives you the power to create custom notification methods. A notification flow can transform the Flow Notification Message input into comments, messages, or other forms of data.
You can use a notification flow when configuring the notification. After selecting the action, or Notification Type, that triggers the notification to be sent a user account is created or a group is deleted. You then select the notification mode (in this case by selecting the Flow checkbox).
Create a custom notification flow by navigating to the folder System > Administration > Notifications > Notification Flows, clicking the Add Processing Flow button.
In this example, we will:
- Create a notification flow that adds a comment to a folder when a document is added.
- Create a notification that uses the notification flow as a notification mode.
- Validate the flow by adding a document to the folder to confirm that the notification flow adds the comment
We begin by navigating to the folder System > Administration > Notifications > Notification Flows. We click the Add Processing Flow button.
Next, name the Flow and click Create to proceed to the Flow Designer.
To start building the flow, we will add the component that will attach a comment to the folder.
The Add Comment component requires information about where the comment should be added and what information the comment should contain. We can set these values using the Mapping Editor.
Select the Add Comment step and click the Edit Input Mappings link in the Actions toolbar.
We see the two inputs required by Add Comment. The entityID input will contain the unique ID of the folder where the comment will be added. The comment will specify the text of the message.
To set the folder location, change the mapping type of entityid to Constant.
Enter the unique ID of the folder in the Value field. Change the mapping type of comment to Build Data, which reveals a list of properties for this object that we can map to the Flow Notification Message.
Change the mapping type of EntityName to Constant.
Map the output of the Flow Notification Message to the EntityName property. Now, when the notification flow is used as a notification mode, the message entered in EntityName will display in the notification.
Click OK to save the changes and close the Mapping Editor. This completes the flow. Save and close the Flow Designer. We then navigate to the folder, where we add a notification by clicking the Actions button in the upper right cornerr, and selecting Add > Setup > Notification to Me.
In the Add Notification to Me popup, in the Notification Type drop down list, we select the Document Created option. In the Notification Modes list, we select the Flow checkbox. In the Notification Flows we check the Pre-Process Notification checkbox. Then, using the Pre-Processing Flow Picker, we pick the flow that we previously created in this tutorial.
Click PICK to pick the entity. Then Add Notification to save and close.
We then validate the notification flow by clicking the Add button and selecting Document.
In the Add Document dialog, we select Choose File. In the Open dialog, we select a file.
Just as we configured it, the notification flow adds a comment to the folder with the text we entered in the Mapping Editor.