← back to Data Events

Getting Started With Data Events

How to set up and get started using Data Events in Fulcrum.

Getting Ready

This assumes you’ve read the Data Events Introduction. As an advanced feature, Data Events are only available on the Professional Plan.

Scenario

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. Screenshot of Data Events button.

Interface

With our expression builder modal window open, let’s take a quick tour of the interface. Screenshot of Data Events builder interface.

  1. Data event expression examples
  2. Editor block
  3. JavaScript Operators
  4. Variables list
  5. Function list and reference for data events

Adding expression

Now let’s enter our expression to expose the hidden field only to certain roles. The 7 lines of JavaScript below define a function named checkRole which evaluates if the user’s role is either ‘Owner’ or ‘Manager’ with the ROLE function, 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. Screenshot of Data Events builder with checkRole code snippet.

If your data events expression is valid, upon saving you will notice the ‘Data Events’ button text now shows ‘Enabled’. Data Events button enabled image. If the expression is invalid, your browser will alert you and you’ll need to debug before being able to save.

Conclusion

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.

Still have questions? Browse our support forum and drop us a line.

Go to support