Introducing Fulcrum Data Events
For the past few months we’ve been alluding to some new features that are in the works. Our 2016 initiatives include providing better mechanisms to access and interact with your data, both at the record level as well as the organization level. Today I’m introducing one of these features, which we are calling Data Events. Data Events introduce a new tier of workflow scripting opportunities, giving users new methods for automating and streamlining the data capture process.
Data Events allow users to perform specific actions when certain events are triggered. Actions can include things like custom alerts and validation messages, setting field values, choices, labels, descriptions, requirement & visibility settings, HTTP requests and more. Event triggers include things like record loading, editing, validating, saving, value changing, and more.
This new functionality enables listening for record changes, programmatically changing values, as well as building dynamic hyperlinks, writing custom quality assurance logic and much more!
How It Works
You can think of Data Events as an extension of calculation fields. While calculation fields allow you to define dynamic expressions for a particular field, data events allow you to define actions for the entire record. You have access to all the existing expressions, in addition to many new functions for building out truly custom workflows. When building your app, you will see a new “Data Events” button in the app builder’s right sidebar. Clicking this launches a window similar to the expression builder for calculation fields. This is where you define data event triggers and actions.
save-record event, which calls the
changeStatus function when the record is saved. Inside the
changeStatus function, we are calling the
SETSTATUS function with a status parameter of ‘inspected’.
This could be expanded to programmatically set the record status based on values from other fields or even filter the list of available status options based on the user or their role. The intent of the Data Events framework is to give additional tools for automation and customization, effectively giving administrators the ability to modify the behavior of the Fulcrum mobile apps to fit their workflow.
We’ve exposed a bunch of new event triggers that you can hook into within your apps:
Record / Repeatable Events
'load-repeatable'- Triggers when the record / repeatable editor is displayed
'new-repeatable'- Triggers when a new record / repeatable is created, after ‘load-record’ / ‘load-repeatable’
'edit-repeatable'- Triggers when a record / repeatable is edited, after ‘load-record’ / ‘load-repeatable’
'save-repeatable'- Triggers immediately before a record / repeatable is saved and after it’s been validated
'validate-repeatable'- Triggers right before the record / repeatable is saved to check any validations
'change-geometry'- Triggers when a record’s / repeatable’s geometry changes
'change-project'- Triggers when a record’s project changes
'change-status'- Triggers when a record’s status changes
'change-assignment'- Triggers when a record’s assignment changes
'change'- Triggers when a field’s value changes
'click'- Triggers when a hyperlink field is tapped
'add-photo'- Triggers when a photo is added
'add-video'- Triggers when a video is added
'add-audio'- Triggers when an audio clip is added
After registering an event to listen for, you’ll generally want to take some type of action. Actions typically fall into the following categories:
Display A Message
ALERT- Displays a message as an alert popup
INVALID- Displays a validation error message and prevent the record or repeatable item from being saved
PROGRESS- Displays a non-dismissible progress message (useful when loading external data)
Set Form Elements
SETDESCRIPTION- Sets the description of a field
SETHIDDEN- Sets the visibility of a field
SETLABEL- Sets the label of a field
SETMAXLENGTH- Sets the maximum length for a field
SETMINLENGTH- Sets the minimum length for a field
SETREADONLY- Sets a field to be read-only or editable
Set Field Values
SETLOCATION- Sets the location of the record
SETPROJECT- Sets the project of the record
SETSTATUS- Sets the status of the record
SETVALUE- Sets the value of a field
Set Field Options
SETCHOICEFILTER- Filters the choices in a choice field
SETCHOICES- Sets the available choices for a choice field
SETSTATUSFILTER- Sets the available choices for a status field
Interact With External Services
OPENURL- Opens a URL for a website or mobile app
REQUEST- Performs an HTTP request and executes the callback on completion
Exploring The Possibilities
Data Events will be enabled for all Professional Plans in the coming weeks. Stay tuned as we will be updating our documentation and developer guides to include more information on this exciting new feature.