Creating Custom Modes of Notification with Notification Flows

Last Updated: 07/15/2016 Introduced in Verision: 2.0

A user can create a special kind of flow, called a notification flow, which 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, along with email, popup or SMS message, when creating a notification.   Using a notification flow, you can create custom notification methods because a notification flow can transform the FlowNotificationMessage input into comments, messages or other forms of data.

You put a notification flow to use when  configuring the notification. After selecting the action, or Notification Type, that triggers the notification to be sent, such as when a document is added to a folder, 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.

Example

In this example, we will:

  1. Create a notification flow that adds a comment to a folder when a document is added to the folder.
  2. Create a notification that uses the notification flow as a notification mode.
  3. 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.

 

 addProcessingFlow

Next, Name the Flow and click Create to proceed to the Flow Designer.

nameFlow

To start building the flow, we will add the component that will add the comment to the folder.

In the Flow Designer start-up window, we expand the category Integrations > All Integrations > Internal Services > Comment category, and select Add Comment component. Click Add to add this component to the flow.
 
 flowStart

Connect the outcome paths in the flow.

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 1 step and click the Show Mapping Editor link in the Properties panel.

showMappingEditor

 

In the list on the right, 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 . . .

entityIdConstant

 

. . . and enter the unique ID of the folder in the Value field.

buildData

 

Change the mapping type of comment to Build Data, which reveals a list of properties for this object that we can map to the FlowNotificationMessage.

commentName

 

Change the mapping type of EntityName to Constant. . .

entityNameConstant

 

. . .then map the output of the FlowNotificationMessage 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.

mapping

We click OK to save the changes and close the Mapping Editor.

This completes the flow, so we save the flow and close the Flow Designer.

We then navigate to the Basic folder, where we add a notification by clicking the Actions button in the upper right, and selecting Add > Notification to Me

addNotificationToMe

 

In the Add Notification to Me pop-up, 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 Pre-Process Notification checkbox. Then, using Pre-Processing Flow picker we pick the Flow that we have created previously in this tutorial.

 

 pickFlow

Click OK to save the notification.

We then validate the notification flow by clicking the Add button and selecting Document.

addDocument

 

In the Add Document pop-up, we click the File selector.

clickFileSelector

 

In the Open pop-up, we select a file and click Open.

Just as we configured it, the notification flow adds a comment to the folder with the text we entered in the Mapping Editor.

Result

 

 

Additional Resources