Creating things, modifying them, and deleting them happens through actions in workflows, while retrieving data can be done both in workflows and elements. This section covers the different actions you can use to create, modify, and delete things.
This action creates a new entry in the database, a new thing, of the type defined at the action level. You can create a new type of thing by clicking on the option at the bottom of the dropdown menu listing all the currently defined types.
Once you pick a data type, you'll be able to add the values you want to assign to some, or all, fields. Each row will prompt you to pick a field (or create a new one), and then define the value of that field, which can be hardcoded or defined as a dynamic expression using the Expression Composer. The evaluated expression should be of the same field type than the field itself, or it will lead to a type inconsistency.
Note that if you create a new thing without assigning some values to some fields, the thing will be created in the database, but will not have fields' values. You can modify this thing with the action below.
The 'Modify a thing' action lets you choose a thing and modify it. Because the thing already exists, you do not need to pick a type, the type will be the type of the thing you defined. An example could be 'Current User'. Once a thing is picked, this action works similarly to the create thing action, you pick the different fields and assign a value to them.
The action 'Delete a thing' deletes it entirely from the database. This can be undone with your application backup options, but cannot be undone through a workflow.
All the actions above apply to a single thing in the database. In some situations, you may need to modify more than one thing at a time, for instance, if you have a data type of things 'message' with a field 'read', you may want to modify all the messages assigned to a user and assign the value 'yes' to 'read'.
Bubble has a few actions to do so. You can modify a list of things, delete a list of things and copy a list of things. It is important to note that for performance and stability reasons, this operation may not be instantaneous, and if you are working on long lists, this can take some time. The operation will happen in the background, but your workflow should not expect an immediate response.
The copy list of things action is currently limited to 50 items to copy (for stability reasons). Nothing will be created if you try to copy a workflow with a list that contains more than 50 items.
It is a good approach to use scheduled workflows when working on lists, as it will make your workflow design simpler. Using scheduled workflows lets you have a process run in the background and will not interfere with the current page workflows. This is where you would do recursive operations on bigger lists.
Watch our Academy quick tip on how to save data easily
Auto binding lets you modify a thing automatically, as a user modifies the input, without using a workflow. This saves time as you do not need to worry about initial content for the input, have a workflow triggered when the value changes, etc. Instead, if an input is set up to autobind a thing's field, the field's value will get updated as soon as the user types something.
The input needs to be in a group or a page that has a type of content defined. The thing of the parent group or the page will be the thing that will get modified. You'll need to set the right permission for this type in order for this to work as intended.