Creatable if and Deletable if

The Ninox 3.11 release introduces "Creatable if" and "Deletable if"—set conditions for record creation and deletion with the formula editor

Creatable if and Deletable if are available for all apps (web app, iPhone/iPad, Mac, Android).

In Ninox 3.11, the functions isAdminMode(), clientLang(), and userLang()are mainly for client-side use. When used with Creatable if and Deletable if features, they give false results because they rely on client-side data, which is not available for server-side processes.

Key features at a glance

  • Conditional data management

    • Creatable if allows for record creation only under specific conditions, for more control over when data is generated.

    • Deletable if blocks records from being deleted by mistake or without authorization, which safeguards data integrity.

  • Enhanced compliance

    • Admins can apply rules that restrict certain actions, such as deleting sent invoices, to ensure adherence to policies.

  • Increased data efficiency

    • Admins can manage the life cycle of records, which avoids creating unnecessary or duplicate entries. This makes data handling more efficient.

  • Greater control in user workflows

    • Users can only create or delete records under specific conditions or through designated actions, which provides tighter oversight of user activities.

  • Easier workflow automation

    • Parts of the workflow, like creating or removing records automatically when certain criteria are met, are streamlined for efficiency.

Comparing create records/delete records and creatable if/deletable if

The features Creatable if and Deletable if offer a nuanced approach to managing data within the formula editor. This is in contrast with the pre-existing methods of create records and delete records, where you only select a user role from a dropdown menu.

While the latter work as a shortcut to manage creation and deletion based on user roles, Creatable if and Deletable if let you specify more precise conditions in the formula editor.


Access Creatable if and Deletable if

  1. Start by creating a new database:

    • Go to your workspace and click the New database tile.

  2. Select a database template:

    • Choose the Offers and invoices template from the list.

  3. Access your database:

    • Once the database is created, open the Offers and invoices database.

  4. Navigate to the Invoices table:

    • Within your database, find and click the Invoices table.

  5. Edit fields:

    • Click on the gear icon ⚙️ erscheint, then choose Edit fields (2) to modify table settings.

  6. Set permissions:

    • In the settings pop-up, click Creatable if or Deletable if (3) to define conditions.

  7. Configure conditions:

    • Use the formula editor that opens to set up your conditions as per the examples provided.

Set up permissions for creating records

  1. In the formula editor, type userHasRole("Supervisor"). This means only users with the Supervisor role can create records.

  2. Click Save to close the formula editor.

  3. Click Save in the table settings to apply changes.

  4. To test, attempt to create a record by clicking the plus icon. If unauthorized, a message saying You are not authorized for this action will appear.

Set up permissions for deleting records

  1. In the formula editor, type Status = 1. This means records with the status Open can be deleted.

  2. Click Save to close the formula editor.

  3. Click Save in the table settings to apply changes.

  4. To test, attempt to delete a record not marked as Open by clicking the trash icon. Upon confirmation, if unauthorized, a message saying You are not authorized for this action will appear.

See also

Last updated