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 functionsisAdminMode()
,clientLang()
, anduserLang()
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
- Start by creating a new database: Go to your workspace and click the New database tile.
- Select a database template: Choose the Offers and invoices template from the list.
- Access your database: Once the database is created, open the Offers and invoices database.
- Navigate to the Invoices table: Within your database, find and click the Invoices table.
- Edit fields: Click the gear icon , then choose Edit fields (2) to modify table settings.
- Set permissions: In the settings pop-up, click Creatable if or Deletable if (3) to define conditions.
- Configure conditions: Use the formula editor that opens to set up your conditions as per the examples provided.
In the Invoices table (while in form view), click the gear icon (1) to access the table settings, then select Edit fields (2) from the dropdown
In the table settings pop-up, click Creatable if or Deletable if (3)
Set up permissions for creating records
- In the formula editor, type
userHasRole("Supervisor")
. This means only users with the Supervisor role can create records. - Click Save to close the formula editor.
- Click Save in the table settings to apply changes.
- 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
- In the formula editor, type
Status = 1
. This means records with the status Open can be deleted. - Click Save to close the formula editor.
- Click Save in the table settings to apply changes.
- 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
Release notes