Buzzy Documentation
  • Welcome to Buzzy
  • Getting Started with Buzzy
    • Getting Started Guide
      • 1. Starting with Buzzy AI
      • 2. The Buzzy Workspace
      • 3. Create a new app
      • 4. Preview and edit your app
      • 5. Manage your app
      • 6. Import your app to Figma
      • 7. Using Buzzy with Figma
      • 8. The Buzzy Figma plugin
      • 9. Creating a simple app
      • 10. Screens and navigation
      • 11. Forms, fields and data
      • 12. Data-driven menus & content
      • 13. Data edit and delete
      • 14. Search, sort and filter
      • 15. User login and registration
    • Buzzy AI or Figma first?
  • Working with Buzzy
    • Buzzy AI
      • About Buzzy AI
      • Kickstart with AI
      • Enhance with Figma
      • Extend with Code
      • Example prompts
      • Tips
      • Troubleshooting Buzzy AI
      • AI tokens and pricing
    • Buzzy for Figma
      • About Buzzy for Figma
      • Learning Figma
      • Creating a new app directly in Figma
        • Step by step version
      • Automarkup
      • Responsive layouts
      • Responsive layout checklist
      • Overflow and scrolling
      • Forms and fields
      • Images and galleries
      • Logging users in to your app
      • Theming
      • Troubleshooting Buzzy for Figma
      • Plugin error messages
    • Buzzy Deployment & App Stores
      • Setting up your custom Buzzy app
      • Connecting your own server
      • Apple & Google App Stores
    • Buzzy Marketplace
      • Buzzy Accreditation
    • Buzzy Project Guide
    • Buzzy App Examples
      • Buzzy Templates
      • AI-Powered Chat App
      • AI-Powered Custom T-Shirt App
      • AI-Powered Strategy App
      • AI-Powered Stock Portfolio App
      • Golf Course Finder
      • Personal Finance App with Figma AI
    • FAQs
  • The building blocks
    • Datatables, Fields & Data
      • Introduction to Fields
      • Basic Fields
        • Text
        • Number
        • Date
        • Location
        • Toggle
        • Checkboxes
        • Checklist
        • Selectlist
        • Rating
        • Attachments
        • Images
        • Signature
        • Audio Recording
        • Embedded Link
      • Advanced Fields
        • Formula
        • Sub tables
        • Linked Table field
        • Button
        • Teams
        • Payment
        • Notification
        • Event
        • User Vote
      • Display Fields
        • Header
        • Display Text
        • Image
        • Divider
      • Metadata Fields
        • Author Name
        • Author Phone
        • Submitted
      • Filter Controls
        • Viewers
        • Tags
        • Condition
      • External Fields
        • IBM Connections File
        • Box File
      • Sort Fields
      • Formulas
      • Datatable to Datatable Relationships
      • Security and Access Control
      • Displaying a field based on the values of other fields
      • Hiding a field based on role using a display formula
      • Importing data from a text file
      • Importing data from a URL
      • Import data from Datatable
      • Export data using Chrome
      • Export data in Browser
      • Export data using Safari
      • Datatable Field Type - Cheat Sheet
      • Troubleshooting Fields & Data
    • Code widget (custom code)
      • Code Widget Fields - Advanced Guide
      • New Async API + React HTML Components
      • Examples
        • Image Galley Slideshow
        • Ratings Average and Distribution
        • Event Locations Map
    • Analytics
  • Troubleshooting
    • App Error Codes
      • Action Error
      • App Not Found
      • Component Missing
      • Component Not Set
      • Component Settings Error
      • Datatable Not Found
      • Datatable Not Set
      • Field Not Found
      • Field Not Set
      • No App Selected
      • No Context Name
      • No Screens Found
      • Runtime Exception
      • Screen Not Found
      • Screen Not Set
    • Troubleshooting Buzzy AI
    • Troubleshooting Figma
  • REST API
    • Buzzy REST API
      • Integrating 3rd party applications
      • REST API
        • login
        • createappwithprompt
        • MicroApp Data Operations
          • microappdata
          • microappdata/row
          • insertmicroapprow
          • updatemicroapprow
          • removemicroapprow
          • microappchild
        • User & Organization Operations
          • userid
          • insertteammembers
          • teammembers
          • insertorganization
          • insertteam
        • enforceteammembership
      • Node.js API Client
      • Datatable Rules
      • Datatabledata Tutorial
      • Integrating with Mailchimp
      • Python Access Datatable
  • Advanced Deployment Settings
    • Installation
      • Pre-installation Planning
      • Deployment
        • Introduction to deployment
        • Minikube install guide
        • AWS ECS Fargate install guide
        • HCL Connections install guide
        • Azure AKS install guide
        • Windows container install guide
      • Buzzy settings
      • Whitelabelling Buzzy
      • Certificates
      • Release Management
    • Performance and Reliability
    • Security
      • Platform
      • Users and Roles
      • Datatables
      • Audit Trail
Powered by GitBook
On this page
  1. The building blocks
  2. Datatables, Fields & Data

Formulas

PreviousSort FieldsNextDatatable to Datatable Relationships

Last updated 1 year ago

Formulas for calculated or computed fields, show/hide formulas and validation formulas all rely on .

Each row in a Datatable will be represented as a JSON object based on field label: field text value.

For example, if we have a row in a Datatable with Product, Price and Quantity, we have a JSON object like:

{
   Product:"Widget 1",
   Quantity: 3,
   Price: 5
}

You could then do things like:

  1. add a Total (formula field type) and set the formula to Quantity * Price

  2. add a validation formula on quantity: Quantity < 10

  3. add cross field validation on Price something like (Quantity * Price) < 100

Example use custom validation for a phone number regex:

Phone ~> /^[+]*[(]?[0-9]{1,4}[)]?[-\s\./0-9]*$/

Where field name is Phone

Example show to owners and authors only:

user.highestRole = "owner"  or user.highestRole = "author"

If the field is of a type that gives you an array… for example field type is Checkboxes, then you can do things like "A" in Checkboxes for the formula, if you wanted to check if “A” was selected and use that to show/hide a field.

The default meta data includes the following variables:

  • _id : the current rows unique ID\

  • _currentUrl: gets the current URL from the browser - only works in forms in "insert/capture" mode.

  • _contextRow: if there is a context row it returns that row. This allows you to access that rows fields, or example _contextRow.someField in your formulas. A example where this could help - eg showing a product and then having a sub-form to submit an order of quantity, color etc for that product and you want the order to include the product it (eg _contextRow.productID)

  • userID: the user ID of the the user who created the row or the creator

  • _currentUserID: the user ID of the currently logged in user - eg used in a display formula to show something different for the logged in user

  • viewers: an array of additional user IDs who can view the row, set by a viewers field type\

  • isLocked: if the row has been locked\

  • submitted: Epoch date time value of the submitted date at the time the server created the record, which may be different to clientSubmitted (see below)\

  • deviceID: capture the device ID, to help debug if a specific device has issues\

  • appVersion: app version of when row was created, to help debug any issues.\

  • hasConflict: an array of conflicts\

  • clientCounter: useful for debugging what records have been sent to the server vs on the client.\

  • clientSubmitted: Epoch time client submitted the record. This may be different to submitted, which is the time the server received and created the record.

Displaying a button based on a valid email you can use a “show” based on regex expression, for example

(Email != null ) and $exists(Email) and  ($match($string(Email),/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/i))

Where “Email” is an email text field

In addition to the current row's date you can also access some basic information about the currently logged in user:

  • user.name: the name of the currently logged in user

  • user.email: the email address of the currently logged in user

  • user.highestRole: the highest role of the currently logged in user

Note, depending on the specific application you are building, typically, you will create a separate user datatable to capture user custom information.

Please ensure you adhere to both Buzzy's terms and conditions as well as other external restrictions and compliance requirements, like GDPR, HIPAA etc related to other privacy and compliance when exposing and using user related data.


JSONATA
image
image