When setting up a Workflow, you will first need to set up a trigger event to determine when the Action will run. For a list of Trigger Events see our article here: Workflow Trigger Events
This article will focus on the Notification Action. A user can be notified by three automated workflow actions. They can receive a system notification, be sent an E-mail or be notified via Slack integration with a Webhook.
Send System Notification
You first need to ensure you are in the 'Workflow' section of AppStudio, it is here under the 'Workflow Actions' Template that you can click 'Add Workflow' to bring up the below pane.
From there, select 'Notify' as the Action and 'Send Notification' as the Result. Then enter the body of the message that you would like to send. For this example we will send a message to a Risk Owner, telling them that a Risk has been added that they are responsible for.
There are then a number of different options that can be selected to determine which Users will receive the notification.
Target Teams: This will send the notification to all the Users in a Team selected from here. Multiple selection is made easier by using the arrow keys and hitting enter.
Target Users: This will send the notification to any Users selected in this List. Multiple selection is made easier by using the arrow keys and hitting enter.
Target Person Fields: If Person Fields have been used in the App then you can select the Field and it will send the notification to the User that has been selected for the Person Field in the Record. In our example for sending the notification to the Risk Owner this could be done by sending it to the User named in the 'Assignee' Person Field.
Target Current User: This could be used to send a reminder notification to the User that added a record with a message to say. 'You added a Risk, remember to ensure you have set the priority and deadline.'
Target Current User's Team: Selecting this option would send the notification to all Users of the Teams that the User who triggered the Workflow was a member of. It could be to say 'A new Risk has been added by a member of your Team'.
Note: If multiple targets have been sent then a User will receive the notification once if they meet any of the target criteria. So if they were selected as the Target User and were a member of a Target Team, they will only receive the notification once.
Note: If no targets are set then the notification will not be sent to any Users.
Send Slack Message
To send a slack notification it will require you to obtain the Webhook from Slack, select 'Notify' as the Action and 'Send Slack message' as the Result.
Next you will need to add a message.
You can reference Record data by using @Softools.FieldValue("FieldID") as a Keyword. You can also add a link to the Record that generated the workflow by adding the Keyword @Softools.RecordLink().
The message will take a similar syntax to Markdown. Here is an example message for when a support ticket has been completed:
A '@Softools.FieldValue("dPriority") @Softools.FieldValue("dType")' ticket has been updated on the Support Ticketing App \n*@Softools.FieldValue("oTicketNumber"): @Softools.FieldValue("oTitle")* @Softools.RecordLink() \n ```Status Update: \n @Softools.FieldValue("dStatus") \n\nAssignee: \n @Softools.FieldValue("pAssignee_Text") \n\nComments: \n @Softools.FieldValue("dComments") \n\nProject: \n @Softools.FieldValue("dProject") ```
Note: For more guidance on Slack message formats, see their support article here.
Once you have added the message you will need to integrate to the correct channel by finding the channel Destination URL. To do this open the channel that you would like to add an integration to and then select 'Add an app' from the COG menu.
Search for 'Incoming Webhooks' to send data to slack in real time. Add a configuration with the chosen channel in the 'Post to Channel'. Then copy and paste the Webhook URL form this screen into the 'Destination URL' and the integration is complete.
Recommendation: Set the 'Customize Name' and 'Customise Icon' options. For more details on setting up incoming Webhooks to Slack see their support article here.
Send Email Notification
You can send an email to a User that contains information from the Record that generated the Workflow. Firstly, select 'Notify' as the Action and 'Send Email' as the Result.
Below is example content for sending information about a RAID item that has turned Status Red:
First select 'Notify' as the Action and 'Send Email' as the Result.
Within the email, you can choose to include a Templated Report as an attachment - at the bottom there is an 'Add Attachment' button allowing you to specify the templated report you wish to attach to the email going out. This needs to be a pre-existing word export template at Record level.
You can then choose if you would like to 'Use Base Template?'. If you select this format then it will format the email to include a Softools header and footer to the body of the message.
You can now set the Subject for the email and the message content. For these you can reference Record data by using @Softools.FieldValue("FieldID") as a Keyword. You can also add a link to the Record that generated the workflow by adding the Keyword @Softools.RecordLink().
For our example we will use the following in the Subject and Message:
@Softools.FieldValue("Title") has turned Status Red
A RAID item (@Softools.FieldValue("Title") ) has turned status RED
Owner : @Softools.FieldValue("Owner_Text")
Client : @Softools.FieldValue("Client")
Due Date : @Softools.FieldValue("DueDate_Formatted")
Click here to load the record : @Softools.RecordLink()
Note: The entry for the message is Rich Text. This means that it if you copy and paste values in then it will keep the text formatting. This may cause a conflict for the @Softools.FieldValue("Field") references if the text format has changed due to a copy and paste of the Field ID. We recommend that you type the full keyword reference and do not copy and paste values into the Email message to avoid this.
Note : Some field types are not supported because the emails are rich text and so cannot support more complex field types such as ImageFields, Grids, InAppChart fields... For these, it is better to include them in a Templated Report and attach that.
Note: Adding a static email address to an email workflow will require you to create an email field in the app with the email as the default value and then reference that field in the workflow as: @Softools.FieldValue("EmialFieldId") otherwise the '@' in the email will try and reference a field that doesn't exist
Following the above example will send an email that looks like this:
Lastly, you will need to say which Users should receive the email. To do this type in the 'To' box and you can search for specific Users and Teams or Users named in Person and Email Fields.
Note: The recipient list must contain one 'To' in order to send the email. If a User is referred to more than once as a result of being selected as a User and a member of a Team and named in a Person or Email Field then they will only receive the email once in priority 'To' then 'Cc' and then 'Bcc'.
Click the 'Add Action' button to save a new workflow action, or 'Save' to update an existing one. Then to save the overall Workflow you must click the 'Save' Button once more.