Creating SMS Rules

How to create an SMS rules in Field Squared.

Here’s the step-by-step of how it works.
How to create a user assignment SMS notification workflow (this will send a text to any user who is added or removed from a task:

Add test tasks – create two tasks with different user assignments, we’re going to use their object IDs to test the workflow.

Create a new workflow in the workflow editor named ‘SMS When User List Changed’

Create a ‘Task Saved’ module named ‘OnTaskSaved’ – this will trigger the workflow any time a task is saved.

  1. Add the two test IDs for test.

Create a ‘Passthrough Condition’ module named ‘CheckUsersChanged’ as a child of ‘OnTaskSaved’ – this will filter out any events where the user list does not change.

  1. Set the ‘Condition’ property to: old.Users <> new.Users

Create a ‘Get Changes’ module named ‘GetChanges’ as a child of ‘CheckUsersChanged’ – this will separate the workflow into two different paths: one for users added, and one for users removed.

  1. Check ‘Split Table’
  2. Set ‘Previous Object Path’ to: RemovedUsers
  3. Set ‘Changed Object Path’ to: AddedUsers

Create a path for added users:

  1. Create an ‘Add Related Objects’ module named ‘AddedUsers’ as a child of ‘GetChanges’ – this gets the user records of users added and makes their phone numbers available.
    • Set ‘Object Type’ to: User
  2. Create a ‘Text Template’ module named ‘WriteAddedMessage’ as a child of ‘AddedUsers’ – this writes a dynamic message to be sent to the user.
    • Set the ‘Template’ property to: You have been assigned to {Task_Name}
    • Set the ‘Template Type’ property to: PlainText
  3. Create a ‘Send SMS’ module named ‘SendAddedMessage’ as a child of both ‘AddedUsers’ and ‘WriteAddedMessage’ – this will send a text to all users who were added to the task
    • Set the ‘Body Source’ property to: WriteAddedMessage
    • Set the ‘To Binding’ property to: {“AddedUsers”:”User_Phone”}

Create a path for removed users:

  1. Create an ‘Add Related Objects’ module named ‘RemovedUsers’ as a child of ‘GetChanges’ this gets the user records of users removed and makes their phone numbers available.
    • Set ‘Object Type’ to: User
  2. Create a ‘Text Template’ module named ‘WriteRemovedMessage’ as a child of ‘RemovedUsers’ – this writes a dynamic message to be sent to the user.
    • Set the ‘Template’ property to: You have been removed from {Task_Name}
    • Set the ‘Template Type’ property to: PlainText
  3. Create a ‘Send SMS’ module named ‘SendRemovedMessage’ as a child of both ‘RemovedUsers’ and ‘WriteRemovedMessage’ – this will send a text to all users who were removed from a task
    • Set the ‘Body Source’ property to: WriteRemovedMessage
    • Set the ‘To Binding’ property to: {“RemovedUsers”:”User_Phone”}

Was this article helpful?

Related Articles