Academy Lesson: Working with Variables in Noca Web
Variables allow you to store, update, and pass data across different pages and workflows in your application. In this lesson, you will learn how to access default variables, create custom variables, and use Variable Actions within your Noca Flows.
Step 1: Access the Variables Panel
Before creating new logic, take a look at where your project’s variables live.
-
Open your project in the Noca AI editor.
-
In the top navigation bar, click on Settings.
-
Select Variables from the left-hand menu of the settings popup.
Step 2: Understand Default Variables
Every Noca project comes pre-configured with two permanent default variables that cannot be removed:
-
ID: A default identifier used to reference specific records or unique data points. -
LWC ID: A variable automatically set by Salesforce whenever your Noca project is embedded directly into a Lightning Web Component (LWC).
Step 3: Create a Custom Variable
You can create your own custom variables to manage state and pass custom data points.
-
Click the + Add Variables button at the bottom of the Variables panel.
-
Type a name for your new variable (e.g.,
newvar). -
Configure URL Parameters: * By default, Noca expects this variable to look for its value inside the page’s URL parameter.
-
If you want the variable to be hidden behind the scenes and accessible globally across all pages, toggle Not URL Parameter to True (On).
-
-
Click Save to apply your changes.
Step 4: Locate Variables in the Data Kit
Once created, your custom variables are instantly available to use inside your automation flows.
-
Navigate to the Events tab on your canvas.
-
Create or open an event (e.g., an On Load event) to open the Noca Flows editor.
-
Add any node to your flow canvas (such as a Salesforce Read action) and open its properties.
-
Open the Data Kit sidebar on the right.
-
Expand App Fields and look under Variables—you will see your newly created variable (
newvar) listed there, ready to be read.
Step 5: Update Your Variable Using “Variable Actions”
To dynamically change the value of your variable during a user’s workflow:
-
In your Noca Flow canvas, click the
+icon to add a new node. -
Search for and select Variable Action.
-
Under Select a Variable, choose your custom variable (
App / newvar). -
Under Select an Action, choose Set (or other mathematical/logical adjustments like Incremental Set).
-
In the Type a Value field, map it to the output of a previous node (like a Salesforce data pull) or type a manual fallback value.
💡 Pro-Tip: Because your custom variable is set to global (Not URL Parameter = True), any value you save to it using a Variable Action on this page can be instantly read and utilized on any other page within your entire project!