This example will carry you through the scenario of using Data Events to expose a hidden field only to Members with specific Roles within your Organization. By default, there are three system-level member roles types included within a Fulcrum account.
Setting Up Data Events
For this example, our app will only have two fields. The Record Label field is seen by all users but we want to keep the Sensitive Field hidden from users in the Standard User role, while allowing it to be seen by Manager and Owner roles.
Data Events button
As you are building your app, you will see a “Data Events” button in the app builder sidebar. This is where you define your data events within the app. Let’s go ahead and click this to enter our expression to define our data event.
With our expression builder modal window open, let’s take a quick tour of the interface.
- Data event expression examples
- Editor block
- Variables list
- Function list and reference for data events
checkRolewhich evaluates if the user’s role is either ‘Owner’ or ‘Manager’ with the
ROLEfunction, from the Calculation Expressions. If the role matches those values, the ‘sensitive_field’ hidden setting will be set to
false, exposing the field to those users - for roles such as ‘Standard User’, the field will stay hidden.
If your data events expression is valid, upon saving you will notice the ‘Data Events’ button text now shows ‘Enabled’.
. If the expression is invalid, your browser will alert you and you’ll need to debug before being able to save.
This is a basic example to get you started with how Data Events can be used with an Event trigger (
load-record) to perform a visibility Action (
SETHIDDEN). Refer to the developer documentation for more examples of data event expressions.