Custom Objects
Learn how to store and sync data with QuickBlox key-value storage.
Custom Objects module provides flexibility to define any data structure (schema) you need, build one-to-many relations between schemas and control permissions for all operations made on data. The schema is defined in QuickBlox Dashboard.
Visit our Key Concepts page to get an overall understanding of the most important QuickBlox concepts.
View list of classes
To view a list of classes, follow the steps below:
- Navigate to the Dashboard => YOUR_APP => Custom page.
- Click the Current Class dropdown to view a list of classes.

Create class
To create a custom object class, follow the steps below:
- Navigate to the Dashboard => YOUR_APP => Custom page.
- Click the Add dropdown and select Add new class menu item.

- Enter the name of the class.
- Enter the name of the field.
- Choose the type of the field.
- Check if the new field is of the array type.
- Add as many fields as you need by clicking the Add field button.
- Click the Create class button.

Delete class
To delete a class, follow the steps below:
- Navigate to the Dashboard => YOUR_APP => Custom page.
- Select a class in the Current Class dropdown.
- Click the Remove dropdown and select Remove class menu item.

Add field
To add a field to a class, follow the steps below:
- Navigate to the Dashboard => YOUR_APP => Custom page.
- Select a class in the Current Class dropdown.
- Click the Add dropdown and select Add field menu item.

- Enter the name of the field.
- Choose the type of the field.
- Check if the new field is of the Array type.
- Click the Add field button. You can add as many fields to the class as you need.

Remove field
To remove a field from a class, follow the steps below:
- Navigate to the Dashboard => YOUR_APP => Custom page.
- Select a class in the Current Class dropdown.
- Click the Remove dropdown and select Remove field menu item.

View list of records
To view a list of records, follow the steps below:
- Navigate to the Dashboard => YOUR_APP => Custom page.
- Click the Current Class dropdown to choose a specific class. As a result, all records of this class are displayed on the page.

Add record
To add a custom object record, follow the steps below:
- Navigate to the Dashboard => YOUR_APP => Custom page.
- Select a class in the Current Class dropdown.
- Click the Add dropdown and select Add record menu item.

- Set fields of the record. The record fields are defined in the class. If the field value isn't specified, a null value is inserted automatically.
- Click the Add record button.

Add child record
You can create a child record. A child record is a record that refers to another record that has already been created, a parent. When a record is created, it is assigned a record ID. Thus, you can create a new record, a child, and attach it to the parent record by pointing to its ID. See this section to learn more about relations between records. To create a child record, follow the steps below:
- Navigate to the Dashboard => YOUR_APP => Custom page.
- Select a class in the Current Class dropdown.
- Click the Add dropdown and select Add record menu item.

- Set fields of the record. The record fields are defined in the class. If the field value isn't specified, a null value is inserted automatically.
- Set a parent ID to refer to a parent record.
- Click the Add record button.

Edit record
To edit a record, do the following:
- Navigate to the Dashboard => YOUR_APP => Custom page.
- Select a class in the Current Class dropdown.
- Click the ID of the record to edit.

- Edit record fields.
- Click the Update record button to save changes.

Remove record
To remove a record, follow the steps below:
- Navigate to the Dashboard => YOUR_APP => Custom page.
- Check the record you want to delete.
- Click the Remove selected button.

Set permissions
You can set a permissions schema. There are two access levels in the permissions schema: class and record. Only one permission level can be applicable to the record: class permission schema or record permission schema.
Class permissions
Only the account owner can create a class in the Custom Objects module and make all possible actions with it.
All actions (Create, Read, Update, and Delete) are available for the class entity and are applicable for all records in the class. Every action has a separate permission level available. The exception is a Create action that is not available for the Owner permission level. See this section to learn about permission levels.
Default class permission schema is used while creating a class:
- Create: Open
- Read: Open
- Update: Owner
- Delete: Owner
To set a permissions schema for the class, do the following:
- Navigate to the Dashboard => YOUR_APP => Custom page.
- Select a class in the Current Class dropdown.
- Click Edit permission button.

- Set a permission level for each CRUD operation here. See this section to learn more about permission levels.
- Check the boxes in Use Class permissions if you want to apply class permissions to all its records.
- Click the Edit permissions button.

A class permission schema has a higher priority than a record permission schema. If an account owner ticks the Use Class permissions checkbox, the record permissions are ignored.
In case, an account owner doesn't tick the Use Class permissions checkbox, a user has a possibility to change permission levels for every separate record in the table or create a new one with the ACL that a user requires.
Record permissions
A record is an entity within the class in the Custom Objects module that has its own permission levels. All permission levels except for the Not Allowed are available for the record and there are only three actions available and applicable for the record: Read, Update, and Delete. See this section to learn more about permissions.
Default Record permission schema is used while creating a class:
- Read: Open
- Update: Owner
- Delete: Owner
To set a permissions schema for the record, do the following:
- Navigate to the Dashboard => YOUR_APP => Custom page.
- Select a class in the Current Class dropdown.
- Click the ID of the record to edit.
- Click the Set permissions on record button.

- Set a permission level for each CRUD operation here. See this section to learn more about permission levels.
- Click the Update record button to save changes.
A class permission schema has a higher priority than a record permission schema. If an account owner ticks the Use Class permissions checkbox, the record permissions are ignored. See this section for more details.
Import data
You can import data in .csv or .json format. To import data, do the following:
- Navigate to the Dashboard => YOUR_APP => Custom page.
- Select a class in the Current Class dropdown.
- Click Browse to choose a .csv or .json file in a local file system.
- Click Import Data.

Import schema
You can import a class schema. The class schema defines class fields and their data types in .yml format. To import a class schema, do the following:
- Navigate to the Dashboard => YOUR_APP => Custom page.
- Select a class in the Current Class dropdown.
- Click the Browse to choose a .yml file in a local file system.
- Click Import Schema.

Updated about 3 years ago