- Create a UI Flow with two pages and choose which one opens first
- Build a form with required fields and bind it to the UI Flow data model
- Start a workflow from a button and pass it the form values
- Show the workflow’s output on a page and navigate between pages
- Run the UI Flow and inspect its session data
- Access to FlowX Designer
- A workspace and project set up (create one here)
What you’ll build
A loan estimator for Acme Bank. The estimateForm page holds a form with two fields. Its Calculate button validates the form and starts thecalculateLoanEstimate workflow with the two values. The workflow returns a loanEstimate object, and the page shows the monthly payment from it. A second page, estimateBreakdown, shows the total repayment and the total interest from the same object.
This is the finished first page at runtime, after a calculation:

Step 1: Build the workflow
The UI Flow needs something to call, so start with the workflow. It takes an amount and a term, applies a fixed annual interest rate of 6.5%, and returns three amounts ready to display. If you haven’t built a workflow before, Build your first workflow covers each of these screens in detail.Create the workflow
calculateLoanEstimate. The workflow editor opens with a Start node already on the canvas.Declare the input and output
amount: Number, Floating PointtermMonths: Number, IntegerloanEstimate: an object with three String attributes,monthlyPayment,totalRepayment, andtotalInterest
amount and termMonths under Input Parameters. On the Output Parameters tab, select loanEstimate; its three fields are selected with it.489.15 would reach the page as 489.1499938964844.Set the Start node sample input
Add the Script node
Calculate payment. Keep the JS language tab and paste:input and publishes its result by assigning output.loanEstimate. Number() makes the math work whether the values arrive as numbers or as numeric strings.
Add the End node
loanEstimate and its three fields, taken from the output parameters you selected. This is what the UI Flow receives.
Run the workflow
Step 2: Create the UI Flow and its pages
Create the UI Flow
- Name:
LoanEstimator - Platform: Web
- Experience Type: Flow-Based
Define the data model
loanAmount: Number, Floating PointtermMonths: Number, Integer
Add the two pages
estimateForm. Select the second page and set it to estimateBreakdown. The identifier is the name you pick later as a navigation destination.Set the home page
estimateForm in the tree and choose Set as Home. The home page is the one the UI Flow opens on when it starts.
estimateForm and estimateBreakdown, with estimateForm marked as home.Learn more about UI Flows
Step 3: Build the form page
Components are added from the UI Assets tab of the left panel (UI Components), by dragging them onto a node in the tree. You can also right-click a node and choose Add UI components. A page holds layout components such as cards, and a card holds the form, the buttons, and the text.Add a card
estimateForm. In Settings, set its Title to Loan estimate.Add the form and its fields
loanForm, and leave Validate on at submit.Drag two Input components into the form and configure them in Settings:required, and fill in the Error Message.
Add the Calculate button
Calculate. You wire it to the workflow in Step 4.Add the result text
${...} reads a value from the UI Flow session data. loanEstimate doesn’t exist until the workflow returns it, and you don’t have to declare it in the data model: workflow output is added to the session data when it arrives.Add the View breakdown button
View breakdown.Learn more about input fields
Learn more about validators
Step 4: Start the workflow from the Calculate button
Actions on UI Flow components are configured as event handlers: a trigger, such as a click, and an action that runs when it fires.Add a click handler
Pick the workflow
calculateLoanEstimate.Validate the form
loanForm. The handler then runs only when both required fields hold a value.Pass the form values as start params
${...} expressions read the form values from the session data. Don’t put quotes around ${...}: each value is inserted already JSON-encoded.Save the handler

loanEstimate) is added to the UI Flow session data, and the Monthly payment text updates.
Learn more about the Start Workflow action
Learn more about event handlers
Step 5: Build the breakdown page and connect the pages
Build the breakdown page
estimateBreakdown and set its Title to Repayment breakdown. Inside it, add two Text components:Back.Both pages read the same session data, so the breakdown page shows the result the first page received without calling the workflow again.Navigate to the breakdown
estimateForm. Under Event Handlers, click +, choose On Click, set Action Type to Navigate To, and in Destination pick estimateBreakdown. Click Save.
Navigate back
estimateBreakdown and add the same kind of handler, with Destination set to estimateForm. Click Save.Learn more about the Navigate To action
Step 6: Run it and inspect the session
Run the UI Flow
{}. Keep the default Theme and click Run.
estimateForm, the home page.Check the validation

Calculate an estimate
25000 and 60 and click Calculate. The page shows Monthly payment: 489.15.Open the breakdown

Inspect the session data
loanEstimate with the three values the workflow returned.
loanEstimate. That loop, page to workflow and back into the session data, is the pattern behind most UI Flow screens.Troubleshooting
The monthly payment stays empty after Calculate
The monthly payment stays empty after Calculate
- The start params keys are exactly
amountandtermMonths, the workflow’s input parameter names. - The
${...}expressions name the form’s data keys,loanAmountandtermMonths, and have no quotes around them. - The workflow’s End Flow node lists
loanEstimatein its Output Schema. - The Text reads
${loanEstimate.monthlyPayment}, with the same spelling as the script’s output.
The monthly payment shows extra decimals, like 489.1499938964844
The monthly payment shows extra decimals, like 489.1499938964844
loanEstimate fields are typed Number (Floating Point) in the workflow’s Data Model. Change all three to String and return them with toFixed(2), as in the Calculate payment script.The Variables tab doesn't show loanAmount or termMonths
The Variables tab doesn't show loanAmount or termMonths
The UI Flow opens on the breakdown page
The UI Flow opens on the breakdown page
estimateBreakdown is the home page. Right-click estimateForm in the Navigation tab and choose Set as Home, then run the UI Flow again.The Data key field finds nothing
The Data key field finds nothing
loanAmount and termMonths with Create Attribute, and pick the key again. The search starts after three characters.The workflow isn't listed in the Workflow dropdown
The workflow isn't listed in the Workflow dropdown
calculateLoanEstimate in the same project as the UI Flow.
