Lesson: Conditional App Logic Based on User Input
Forms become significantly more intelligent when they don’t just change visually, but actually alter how your application processes data behind the scenes. In this lesson, you will learn how to configure Conditional Logic within your app’s button event handlers. This allows your app to dynamically switch backend execution paths based on user input—routing “Personal” sign-ups down one pipeline while spinning up full enterprise account structures for “Business” selections.
Why Conditional App Routing Matters
Not all user submissions are created equal. A customer registering as an individual should not be processed the same way as an enterprise client. By embedding conditional logic directly into your app’s button triggers, you can split your application’s data pipeline into separate, specialized pathways, ensuring records are structured correctly in your CRM automatically.
Step 1: Locate the Submission Event Trigger
-
Open your Contact Us page inside the Noca Web Builder workspace.
-
Open the Events panel from the top-right toolbar.
-
Locate the interactive button element row labeled On Click “Send Message”.
-
Click the Plus (+) icon to open a clean Noca Flows canvas tied directly to this button interface.
Step 2: Add a Logic Condition to the App Flow
-
Click the Plus (+) node block directly following your initial app action trigger.
-
Select Logic from the options menu, and choose Condition.
-
This block acts as a sorting gate right inside your app’s processing engine, splitting your workflow paths based on what the user chose on the page.
Step 3: Define the Condition Mapping Rules
Configure the condition block to evaluate the user’s form selection:
-
Open the condition properties and target your Client Type dropdown element.
-
Set up Rule 1:
If Client Type Selected Value is Equal to...Personal. -
Add a secondary branching rule row targeting the same dropdown element:
If Client Type Selected Value is Equal to...Business. -
Label your split pathways clearly as Personal and Business to keep your canvas clean.
Step 4: Map the “Personal” App Pathway
If the application detects the user selected the “Personal” option, execute a streamlined record setup:
-
Drag a Salesforce Create Object node onto the Personal logic branch. Set the target object to Contact.
-
Link the form inputs from the left-side Data Kit directory (First Name, Last Name, Email, Phone Number) straight to the matching Salesforce Contact properties.
-
Append a secondary Salesforce Create Object node immediately downstream. Set this target object to Case.
-
Map the form’s Message input box to the Case Description field, and map the Contact ID using the automated reference variable generated by the preceding step.
Step 5: Map the “Business” App Pathway
If the app detects the user selected the “Business” option instead, configure it to build a more complex, relational hierarchy:
-
Drag a Salesforce Create Object node onto the Business branch. Set the target object to Account.
-
Map your form’s conditional Company Name text input to the Salesforce Account Name property.
-
Add a subsequent Salesforce Create Object node to generate a Contact. Connect the standard user fields, but crucially, map the Account ID to the ID generated by the preceding Account creation step.
-
Add a final Salesforce Create Object node downstream to create a Case, automatically tying the issue ticket back to the parent Account ID and mapping the Description from the user’s message.
Step 6: Go Live and Run a Multi-Path Audit
-
Toggle the logic workspace switch to Go Live and click Save inside the main page builder window to compile the updated click listeners.
-
Click Preview App to open the simulator and test both distinct app paths:
-
Path Audit A (Personal): Fill out the form fields, select Personal, type a message, and click send.
-
Path Audit B (Business): Click send another message, fill out the form, select Business, fill out the newly appeared Company Name field, and hit send.
-
-
Open your Salesforce dashboard. Verify that the “Personal” submission created a standalone contact with an attached case, while the “Business” submission automatically generated a fresh Account entity, holding both the contact and case records completely nested inside it!