Create object
Last updated
Last updated
The Create object action node adds a new object in a data source.
This action node is used to create a new object with a set of properties defined by its object class. The object class is set on the data source that the object is created in.
To understand the differences in behavior when creating an object in a database-connected data source compared to a runtime-only data source, see Database-connected and runtime-only data sources under Data sources.
When an object is created it is assigned an automatically-generated, globally unique identifier. This is stored in the ID property. The ID consists of 24 characters (letters and numbers) and will never change. For example, 605b5cdd5527f30cf344ab2a
.
Good to know
Objects can also be created automatically in runtime-only, single-cardinality data sources by selecting Auto Create on the data source.
Your app is used to manage projects. You'd like for users to be able to add tasks to a project.
To do this, add a Add task
button in the project detail view. Trigger an action when this button is clicked that runs Create object and adds a new Task
object in a runtime-only single-cardinality data source. Use Values on create to set a Project
property to the relevant project, connecting the task to the project.
Run an Open Dialog action node to display a dialog containing input components bound to other properties on the Task object that the user should set. Add a Save
button to the dialog that triggers an action with a Persist objects action node to save the new object to the database.
Note that the object needs to be created before the user can enter any data.
Property | Description |
---|---|
Data Source
Select a data source to create the object in.
Replace Existing Object
Available if Data Source is a runtime-only data source. Remove any existing objects in the selected Data Source before the new object is created.
Copies
Available if Data Source is a runtime-only, many-cardinality data source. Create multiple objects at once by setting the number of copies to create. All objects will have the same values as set under Values on create but each will have a unique ID.
Set Selected
Available if Data Source is a many-cardinality data source. Set the newly created object as selected.
Values on create
Set values for any object class properties in the new object.