Bubble is a no-code platform that empowers users to build fully functional web applications without writing traditional lines of code. However, to create dynamic behaviors, manage data, and connect external services, you will need to write expressions, queries, and API integrations. Learning how to "write in Bubble" means mastering its logic layer, which drives the interactivity behind the visual interface.
Understanding Expressions and Dynamic Data
At the core of writing in Bubble is the concept of expressions. Whenever you set a field's value or define a workflow action, you use Bubble's expression editor. For example, to display a user's name on the screen, you don't hardcode it; instead, you write an expression like Current User's Name. To concatenate strings, use the & operator, such as "Welcome, " & Current User's Name. Mastering these dynamic expressions is the first step toward building responsive applications that react to user input in real time.
Writing in the Workflow Editor
Workflows are the engines of your Bubble application. Every time you add a workflow action, you are effectively instructing the app on what to do next. To write complex logic, you will frequently use the Only when... condition field. For instance, if you want to restrict an action to only logged-in users, you write Current User is logged in. When you need to manipulate specific numbers, you can use math expressions, like adding 1 to a custom state or using expressions like 1 + 1 or Parent group's Thing's value to calculate sums directly within your workflows.

Effective Database Queries
Writing in Bubble also involves querying your database. To retrieve a list of items, you use Search for... followed by your constraints. To refine these searches, you will write constraint logic. For example, to find all tasks assigned to the current user, you write Assignee = Current User. When searching for items within a list, you might write expressions like Task's Status is "Complete". You can also limit results, order them by specific fields, and handle unique identifiers by writing expressions like unique ID.
Handling Text and Numbers
To manipulate specific values in your workflows, Bubble provides a robust set of operators and functions. For text, you frequently use expressions to truncate or extract parts of a string, such as extract with Regex or change first letter to uppercase. For numbers, you perform mathematical operations, such as round, ceiling, or Parent group's Price * Parent group's Quantity. Understanding how to format these values correctly is crucial for accurate calculations and user-facing displays.
Making API Calls and Writing Plugins
To extend Bubble's capabilities, you often need to connect with external services using the API Connector. Writing API calls involves defining parameters, setting authentication headers, and parsing the JSON response. While the visual editor handles much of the setup, writing custom plugins often requires knowledge of JavaScript. In these cases, you write JavaScript code directly within the plugin editor, manipulating elements using expressions like :last-child or first-child. These snippets run directly in the browser, bridging the gap between Bubble's visual logic and custom front-end behaviors.

Workflow Expressions and Arithmetic
When building complex arithmetic logic, writing expressions directly into your workflows is necessary. For instance, to find the difference between two values, you write Parent group's Price - Parent group's Discount. You can also use mathematical formulas within text inputs to process numbers, such as 1 + 1 or specialized expressions for finance or scientific calculations. If you find that specific calculations aren't working, ensure you are converting values, such as applying :extract with Regex to clean up text before treating it as a number.
Writing Pure Expression Logic
Sometimes, you need logic that cannot be easily handled by standard workflows. This is where pure expression writing comes into play, often utilizing the "evaluate-javascript" actions within plugins. For example, to dynamically extract a specific value from a complex dataset, you might write an expression that looks up fields using syntax like thing's creator or thing's assignee's email. To make your logic more readable, especially with long expressions, you can break them down into custom states or reusable elements, writing smaller, manageable pieces of logic instead of one long, convoluted line of text.
Making API Calls and Advanced Plugin Logic
When integrating with third-party services, you need to write specific parameters for API calls. For example, when sending a POST request, you define the body as a JSON object, writing key-value pairs like "name": Current User's Name. To secure these calls, you often write authentication tokens into headers, such as "Authorization": "Bearer " & Get API Token. For writing advanced front-end logic, custom plugins utilize JavaScript. When you need to do something like document.querySelector('.my-class') or manipulate DOM nodes, writing JavaScript is essential. These advanced writing capabilities allow you to extend Bubble's native features, ensuring your web application can handle complex, enterprise-level tasks.






















