Bubble Docs
  • Introduction
  • New? Start Here
  • What is Bubble?
  • The Glossary
  • User manual
    • Getting started
      • What is Bubble?
      • Building your first app
        • Planning features
        • Database structure
        • Design and UX
        • eCommerce and payments
          • Shopping cart
          • Checkout page
          • One-time payments
          • Subscriptions
          • Marketplace
      • Creating and managing apps
      • The Bubble editor
        • Tabs and sections
          • Design tab
            • The element tree
            • The property editor
          • Workflow tab
          • Data tab
          • Styles tab
          • Plugins tab
          • Settings tab
            • Application settings
              • Custom headers/body
              • Visual settings
              • Social media sharing
              • Translating your app
              • Email settings
              • Collaboration
            • Custom domain and DNS
          • Logs tab
        • Tools
          • Key features
          • The search tool
          • The Issue Checker
          • The element tree
          • The element property editor
          • The debugger
          • Notes
        • Previewing your app
      • Transitioning to Bubble from...
        • JavaScript
        • HTML and CSS
        • SQL
    • Design
      • Elements
        • The element hierarchy
          • The element tree
        • The page
        • Containers
          • Groups
          • Repeating groups
          • Table elements
          • Popups
          • Floating groups
          • Group focus
        • Visual elements
        • Input forms
          • Text and numbers
          • Dates and time
          • File uploads
          • Selection controls
        • Reusable Elements
      • Styling
        • Color variables
        • Font variables
        • Styles
        • Custom Fonts
      • Responsive design
        • Building responsive pages
        • Legacy articles
          • The Basics (Legacy)
          • Building Responsive Pages (Legacy)
          • Migrating Legacy Pages
          • Tips When Designing (Legacy)
      • Templates
      • The Component Library
      • Importing from Figma
    • Data
      • The database
        • Data types and fields
        • Creating, saving and deleting data
        • Finding data
        • Displaying data
        • Protecting data with privacy rules
        • The database editor
        • Export/import data
          • Exporting data
          • Importing data (CSV)
        • Working with location data
        • Using Algolia
        • Database structure by app type
          • Marketplace Apps
          • Directory & Listings Apps
          • Social Network Apps
          • SaaS Apps
          • Project Management Apps
          • CRM Apps
          • Professional Services Apps
          • On-demand Apps
          • Documentation/ CMS Apps
          • Applicant Tracking System (ATS) Apps
          • Portfolio Apps
          • Gallery Apps
          • Online Store / Ecommerce Apps
          • Blog Apps
          • Messaging App
          • Dashboards
          • Building Block Apps
          • Bubble as a backend
      • Files
      • Images
      • Static data
        • App texts (translations)
        • Option sets
      • Temporary data
        • Custom states
        • URL parameters
      • User accounts
        • Authentication plugins
          • Facebook plugin
          • Fitbit plugin
          • Google plugin
          • Instagram plugin
          • LinkedIn plugin
          • Pinterest plugin
          • Slack plugin
          • Wistia plugin
          • YouTube plugin
        • Cookies set by Bubble
      • Time, dates and time zones
    • Logic
      • The frontend and backend
      • Workflows
        • Events
          • Frontend events
            • Recurring workflows
            • Custom events
          • Backend events
            • Database trigger events
        • Actions
        • API Workflows
      • Dynamic expressions
      • Conditions
      • Navigation
        • Single-page applications (SPA)
        • Multi-page applications
        • Page slugs
    • Workload
      • Understanding workload
        • Activity types
        • The workload calculation
        • Client-side and server-side processing
      • Tracking workload
        • Measuring
          • Using App Metrics
        • Monitoring
          • Workload notifications
          • Infinite recursion protection
      • Optimizing workload
        • Optimization framework
        • Optimization checklist
          • Page load
          • Searches
          • Workflows and actions
          • Backend workflows
        • Agency showcases
          • Minimum Studio
          • Neam
          • Support Dept
    • Security
      • Bubble's security features
      • Planning app security
      • Client-side and server-side
      • Bubble account security
      • App security
      • Page security
      • Database security
      • API security
        • API Connector security
        • Data API security
        • Workflow API security
      • Flusk
        • Overview
        • Flusk plan features
        • Getting started with Flusk
        • Flusk security tools
          • The Issues Explorer
          • Issue details
          • Tools and settings
            • Pages rating
            • Database rating
        • Flusk FAQ
      • Cookies
      • Security checklist
    • Publishing your app
      • Web app
      • Native mobile app
        • Global native mobile settings
        • iOS App Store
        • Google Play Store
        • Publishing FAQ
    • AI
      • Generate apps with AI
        • About AI app generation
      • AI page designer
      • Connect to AI agents
    • Maintenance
      • Collaborators
      • Version control
        • Best practices: Version control
        • Transitioning from the legacy version control
        • Terminology: Version control
        • Version Control (legacy)
      • Commenting
      • Database maintenance
        • Copying the database
        • Restoring database backups
        • Bulk operations
          • Bulk operation methods compared
        • Wiping change history
      • Performance
        • Hard limits
        • Capacity Usage (legacy)
        • Notes on queries
      • SEO
        • Introduction to SEO
        • SEO: App
        • SEO: Page
      • Testing and debugging
        • Introduction to testing and debugging
        • The debugger
        • The server logs
        • Supported browsers
      • API workflow scheduler
    • Integrations
      • API
        • Introduction to APIs
          • What is a RESTful API?
        • The Bubble API
          • Bubble API terminology
          • Authentication
            • How to authenticate
            • No authentication
            • As a User
            • As an admin
          • The Data API
            • Data API Privacy Rules
            • Data API endpoints
            • Data API requests
          • The Workflow API
            • Workflow API privacy rules
            • Workflow API endpoints
            • API workflows
              • Creating API workflows
              • Scheduling API workflows
              • Recursive API workflows
              • API Workflow Scheduler
              • Case: Stripe notifications
        • The API Connector
          • Authentication
          • API Connector security
          • API guides
            • OpenAI
              • Authentication
              • Calls
                • ChatGPT
                  • Chat
            • Google Translate
              • How to setup Google API keys
          • Streaming API
        • API security
        • Plugins that connect to APIs
        • API Glossary
      • Plugins
        • What Plugins Can Do
        • Installing and using Plugins
        • Authentication plugins
        • Special Plugins
      • SQL Database Connector
      • Bubble App Connector
      • WorkOS
        • WorkOS SSO
        • WorkOS API
    • Infrastructure
      • Sub-apps
      • Bubble release tiers
      • Hosting and scaling
        • How Bubble hosting works
        • Scaling with Bubble
        • CDN (Cloudflare)
        • Bubble app names
        • Domain and DNS
      • Compliance
        • GDPR
        • SOC 2 Type II
        • HIPAA
        • Other frameworks and standards
    • Bubble for Enterprise
      • Hosting and infrastructure
        • Dedicated instance
          • The Dedicated editor experience
          • Technical specs
          • Main cluster dependencies
          • Customizable options
          • Migration process
            • Pre-migration
            • During migration
            • Post-migration
      • Security and compliance
        • Single sign-on (SSO)
        • GDPR
        • SOC 2 Type II
        • HIPAA
        • Other frameworks
        • Bubble's security features
      • Admin and collaboration
      • Priority support
      • Billing and Payment Guideline for Dedicated Instances
  • Core Reference
    • Using the core reference
    • Bubble's Interface
      • Design tab
      • Design tab (Legacy)
      • Workflow tab
      • Data tab
      • Styles tab
      • Styles tab (Legacy)
      • Plugins tab
      • Settings tab
      • Logs tab
      • Template tab
      • Toolbar
      • Top and context menu options
      • Deployment and version control
        • Deployment & Version Control Dropdown (legacy)
      • Notes
    • Elements
      • General properties
      • General properties (Legacy)
      • Styling properties
      • Styling Properties (Legacy)
      • Responsive Properties
      • Responsive Properties (Legacy)
      • Conditional formatting
      • States
      • Page Element
        • Page Element (Legacy)
      • Visual Elements
      • Containers
      • Container Layout Types
      • Containers (Legacy)
      • Input Forms
      • Reusable Elements
      • Element Templates (legacy)
    • Workflows
    • Events
      • General events
      • Element events
      • Custom events
      • Recurring event
      • Database trigger event
    • Actions
      • Account
      • Navigation
      • Data (things)
      • Email
      • Element
      • Custom
    • Data
      • Data Sources
      • Operators and comparisons
      • Search
      • Privacy
    • Styles
    • API
      • The Bubble API
        • The Data API
          • Authentication
          • Data API endpoints
          • Data API requests
        • The Workflow API
      • The API Connector
        • Authentication
        • Adding calls
    • Bubble-made Plugins
      • AddtoAny Share Buttons
      • Airtable
      • API Connector
      • Blockspring
      • Box
      • Braintree
      • Bubble App Connector
      • Chart.js
      • Circle Music Player
      • Draggable Elements
      • Dropzone
      • Facebook
      • Fitbit
      • Full Calendar
      • Google
      • Google Analytics
      • Google Optimize
      • Google Places
      • Ionic Elements
      • iTunes
      • Slidebar Menu
      • LinkedIn
      • Localize Translation
      • Mixpanel
      • Mouse & Keyboard Interactions
      • Multiselect Dropdown
      • Progress Bar
      • Rich Text Editor
      • Rich Text Editor (Legacy)
      • Screenshotlayer
      • SelectPDF
      • Slack
      • Segment
      • Slick Slideshow
      • SQL Database Connector
      • Star Rating
      • Stripe
      • Tinder-like Element
      • Twitter
      • YouTube
      • Zapier
    • Application Settings
      • App plan
      • General
      • Domain / email
      • Languages
      • SEO / metatags
      • API
      • Collaboration
      • Sub-apps
      • Versions
  • Account & Marketplace
    • Account and billing
      • Pricing and plans
        • Plans and billing
        • Billing cycle
        • FAQ: Pricing and Workload
      • Account Management
      • Building Apps for Others
      • Selling on the Marketplace
      • Plans & Billing (legacy)
    • Official Bubble Certification
      • Hiring certified developers
    • Building Plugins
      • The Plugin Editor
      • General Settings
      • Updating to Plugin API v4
      • Adding API Connections
      • Building Elements
      • Building Actions
      • Loading Data
      • Publishing and versioning
      • Github Integration
    • Building Templates
    • Application and data ownership
    • Marketplace policies
    • Bug reports
  • Vulnerability Disclosure Policy
  • Beta features
    • About the Beta features section
    • Native mobile apps 🔒
      • Introduction
        • What is a native mobile app?
        • Native mobile vs. web development
        • Differences in native and web elements
        • Native mobile app terminology
      • Building
        • Views and navigation
        • Native mobile actions
        • Components and gestures
        • Device resources
          • Location services
          • Camera/photo library
      • Previewing
      • Publishing
Powered by GitBook
On this page
  • What are bulk operations?
  • The bulk operation feature
  • Using the bulk operations feature
  • Building the API workflow
  • Valid bulk operations feature parameters
  • Adding actions to the API workflow
  • Running the bulk operation feature
  • Combining the bulk operations feature with views
  • Cases
  • Case 1: Using the Bulk feature in the database editor to change a list of users
  • Case 2: Adding a discount to a list of Products from your app
  • Bulk operations in your app

Was this helpful?

  1. User manual
  2. Maintenance
  3. Database maintenance

Bulk operations

This section covers the bulk operations, which lets you run API workflows on a list of things directly from the Bubble database editor

Last updated 1 year ago

Was this helpful?

Bulk operations terminology

In this article, we will refer in bulk operations in two different ways:

  • Bulk operation refers to any bulk operation performed by your app, using the methods described below.

  • Bulk operation feature refers specifically to using the feature in the Bubble database editor.

For other terminology, please see the Bubble glossary:

Article:

This article focuses on performing bulk operations by using the bulk operation feature in the Bubble database editor. If you're looking for ways to perform bulk operations in your app, we have links to relevant methods at the .

What are bulk operations?

In the context of the Bubble database, bulk operations are any kind of process that you apply to multiple things simultaneously or sequentially. While the Make changes to a list of things action is technically a bulk operation, we generally mean working on longer lists (100+ things) and sometimes more advanced processing.

Bulk operations can mean doing stuff like:

  • Making changes to specific fields in a list of things

  • Deleting a long list of things

  • Creating a list of new things

The bulk operation feature

Note on emails: the bulk operation feature cannot be used to mass send emails.

Note: Bulk operations are performed server-side, but the bulk operations feature relies on client-side actions that depend on your browser window staying open and active.

In other words, you need to keep the popup open for them to continue until the process is done.

The bulk operation feature is an in-editor operation that you can run directly from the database editor. Technically, this does the same as scheduling an API workflow, where you select an API workflow to run, and it will process the currently viewed list of things, or the things you have selected.

  • The bulk feature only supports one parameter: the list of things you want to make changes to

  • You don't need to add any events in your app (such as a button click) – it can be executed from the Bubble editor

  • Since this is an extension of the Schedule API workflow on a list function, the processing will be done in parallell, as opposed to in sequence

Using the bulk operations feature

Building the API workflow

Before you can perform bulk workflows on your data, you need to build the API workflows that you are going to call.

If you are not familiar with Bubble's Workflow API and how to set up API workflows, we recommend you first get to know how they work. The first link below gives an introductory guide to the Workflow API in general, and the second shows you how to set up API workflows that can be used with bulk operations.

Valid bulk operations feature parameters

To be valid for scheduling by the Bulk operation feature, API workflows must have a few properties in place:

A thing parameter: the workflow must include a parameter that requires a 'thing' of the same data type as the one you intend to perform the bulk operation on:

Only set up one parameter: when a bulk operation is called, Bubble will only fill one parameter: the thing it's currently scheduling the operation on. In other words, do not set up any other parameters.

The thing cannot be a list: bulk operations are scheduled one-by-one on a list of things. In other words, the parameter that asks for which thing to perform the operation on should ask for a single think, not a list/array.

It does not need to be exposed as a public API Workflow: while it will still work if you expose it, it's better to uncheck the checkbox to make sure that it cannot be triggered from outside of your app.

Adding actions to the API workflow

Now we have an API Workflow that accepts a single parameter: the thing that we want to run the operation on. In our example we set that thing to a custom data type called Product, so let's make a change to that thing. We have a on the product called Published that we want to set to yes.

In our API Workflow, this is a very simple operation:

  1. First, we add the Make changes to a thing action to the API Workflow

  2. Then, we choose product as the thing we want to change. This is the parameter we set up earlier.

  3. Finally, we set the Published field on the product to yes

Running the bulk operation feature

Now that we have the workflow we want to run the bulk operation on, let's see how we trigger it to run.

  1. First, we select the data type that we want to run the bulk operation feature on. In this case, we want to work with Products

  2. Next, select the Products that you want to run the bulk operation feature on. Trucker cap and Baseball cap are ready to be published, but Product 1 still needs some work, so let's just check to two top ones.

  3. Then, we click the Bulk button, where we'll select with API Workflow to run on the selected things.

The bulk operation feature typically make changes to a list of records. If you make a mistake when running the bulk operation feature, you can restore the data type to what it looked like before the operation by using the feature.

We also recommend testing your API workflow in the before making changes to .

  1. In the first dropdown, we choose what list to run the operation on. You can choose to run it on the entire current view, or the selected entries – in our case we specifically selected two entries, to let's go with that

  2. In the second dropdown you will find the list of compatible API Workflows. If the Workflow does not accept the same data type as a parameter, it will not be selectable

  3. The text next to point three confirms that the workflow will in this case be run on 2 entries, which is what we selected

  4. Finally, we can click Run workflow and the operation will start. Since we are only making a small change on two entries, it should finish very quickly.

Looking again at the data in our database, we can see that the two data types we selected now have their Published field set to yes.

Combining the bulk operations feature with views

Views let you filter the data displayed in the database editor by specific constraints, just like the Do a search for data source. Since bulk operations feature lets you run the operation on all records in the current view, you can combine these features to flexibly run bulk operations on things that match specific criteria, instead of manually selecting the things in the list.

To set up a new view, click the New view button or the pencil icon next to the data type you want to run an operation on.

Cases

Case 1: Using the Bulk feature in the database editor to change a list of users

In the first case, we'll make a fairly simple change to a list of Users. We're going to assume that you already have a collection of users in your app, and you want to introduce roles for these users, such as admin and regular user. Furthermore, we'll assume that all registered users thus far will be regular users, meaning that we can apply the change to all users in the database.

The roles are saved in an called Roles.

What we would to do is:

  1. Search for all users without any constraints

  2. Specify the role we want those users to be assigned

  3. Save that value in the Role field (option set) saved on the User data type.

This is an operation we can run directly from the Bubble database editor using the Bulk feature.

  • Since we want to apply it to all users, we don't need to set up any constraints. We can apply the bulk operation to all Users in the database.

  • We only need to send one parameter (the list of Users), and can specify the Role option set to apply to those users in the API workflow itself, since it's the same for everyone

We'll assume you have already set up the fields and option set needed. First, let's have a look at what that API workflow needs to look like:

Let's go over the two points:

  1. We've given the API workflow a fitting name, and made sure it's not exposed publicly, since we don't want to trigger this workflow from an external system

  2. We've set up a parameter called user, and set the type to User

Note that point two is not a list. This is because the Schedule API workflow on a list action handles items individually. In other words, one workflow runs per item in the list – it doesn't make changes to the entire list in one operation (even if the workflows are executed in parallell).

Let's check out the action that makes changes to the User:

Since all users will have the same role, we specify the value directly as a static value in the user. The data source is set to the option set Roles, and the value Regular user.

And we're done! Let's see how we would run that from the Bubble editor:

As you can see, the Role field on all Users is empty as of now. Click the Bulk button in the top-right corner to start the process. This brings up the window below:

  1. First, we pick the workflow that we created earlier. This is listed as a valid choice for two reasons:

    • The API workflows has only one parameter: User.

    • We are currently looking at the list of Users in the database.

  2. Then, click Run workflow.

In this example, we had only five things to change, and the operation will normally finish in less than a couple of seconds.

Case 2: Adding a discount to a list of Products from your app

Let's say that you are running an eCommerce store, and you have a list of a custom data type called Products that your customers can buy. We also have a list of You make the decision to discount products from a specific vendor by 25%, and you store that discount in a field on each product called Discount. Each Product already has a field called Price, that reflects the regular price of the product.

What we would need to do in that case, is:

  1. Search for all Products from that Vendor

  2. Specify a discount to add

  3. Save that value in the Discount field on each of the Products found in step 1

We are going to use Schedule API workflow on a list to make the changes. In this example, we can't use the Bulk feature in the Bubble editor, for two reasons:

  • We need to search for the correct Vendor in the database (database views cannot specify a database thing as a filter)

  • We need to send multiple parameters (the Product to change and the discount value) (The Bulk feature only supports one parameter – the thing to change)

Instead of using the bulk feature, we'll set up a very simple form that accepts two parameters, as well as a button that starts the operation:

With that form set up, we can choose a Vendor from the database, specify a discount, and then click the button to start the Schedule API workflow on a list process. As we explored earlier, shortly after the button has been clicked (Bubble's loading bar will show), the operation starts on the Bubble server, meaning that you can close the browser tab and the operation will continue to run until it's finished. The time it takes to schedule the workflow can vary somewhat depending on the length of the list.

For the next step, we're going to set up the scheduling action when the button is pressed. Right-click the button and select Start/Edit Workflow in the dropdown menu or click ⌘ + K / Ctrl + K to create the in the .

Let's go over the screenshot point-by-point:

  1. First, we search for the Products we want to process

  2. We specify the Vendor selected in the dropdown as a constraint

  3. The scheduled date we want to process the list: makes sure we run it immediately.

  4. This field specifies what we want to make changes to. In our case, we want to make changes to each product in the list. By setting the data source as This product, we specify that the changes should be applied to the individual Product currently being processed by this specific API workflow.

  5. Finally, we use the Input discount field's value as the data source for the discount to apply

This kind of workflow can be used both in one-off scenarios, or as a standard feature in your app. As we've seen, it's quick to set up and will reliably finish even on long lists of things.

Bulk operations in your app

If you need to set up and perform bulk operations in your app, as opposed to in the Bubble editor, there are three common methods outlined below that are used for this purpose:

Schedule API workflow on a list – used to schedule bulk operations in your app

The Schedule API workflow on a list action is a way to run an API workflow on a list of things. This means that you can apply an action to a thing in isolation. For example, if you have a list of users, you can use this action to update each user's profile, send emails, or perform other tasks for each user on the list, all in a single operation. It's a powerful tool for batch processing, allowing you to execute workflows efficiently and simultaneously on multiple data entries.

  • The fastest and most way to do bulk operations

  • The quickest and simplest way to set up in the Bubble editor

  • Runs workflows in parallell

  • Stable and reliable

  • Can be executed directly from the Bubble editor using the Bulk feature

  • Runs in the , meaning that it doesn't matter if the user closes their browser tab

Recursive API workflows - used to process a list of things server-side and in sequence

are not technically a Bubble feature, but an alternative method for processing lists of things. Instead of scheduling all the workflows in one action (Schedule API workflow on a list), a recursive schedules only one API workflow, and an action inside of that workflow re-schedules that same workflow again. This makes the operation different in a few ways:

  • Somewhat slower and less WU-friendly

  • Runs in sequence, rather than parallell

  • Can use data from a previous cycle in the new cycle

  • You can control the timing of each cycle dynamically

  • Can if the operation places too high a demand on the server

For most scenarios, Schedule API workflow on a list is your most performant and reliable method, but for added flexibility in terms of dynamic parameters, or if for any reason you need the actions to be executed sequentially, you can use recursive workflows.

Make changes to a list of things - used to do near-instant changes to a short list of things

This is an action that can be triggered both in the front-end and back-end. It makes changes to multiple things at once, but does not process the things one-by-one. Make changes to a list of things is good for making simple changes to a maximum of a few hundred things. For longer lists, or where you require more dynamic options in what to change, one of the above methods is recommended.

  • Works on shorter lists

  • Very quick to set up

  • May add some visible loading time to the app if the list is long

There are also actions for copying a list of things and deleting a list of things. These two should only be used for shorter list.

Article: Article

Article: Reference:

Article:

Reference: | |

The Workflow API
API Workflows
Recursive API workflows
Bubble glossary
bottom of the article
Scheduling API workflows
The API Workflow must have a parameter that lets you specify a thing to run the workflow on. In the example above we're instructing Bubble to request a thing of the type Product.
Click the image to enlarge.
Click the image to enlarge.
Click to enlarge the image.
Click the image to enlarge.
Click the image to enlarge.
Make changes to a list of things
Delete a list of things
Copy a list of things
Schedule API workflow on a list