I have a multi-step onboarding flow where a variable calculates which step to display based on user data from Xano. The variable recalculates correctly when data loads, but the UI doesn’t update to reflect the new step.
Read only link for Wized project: Wized
Setup
-
Backend: Xano
-
Frontend: Webflow + Wized
-
Payment: Stripe
-
Calendar: Nylas integration
The Flow
5-step onboarding process:
-
Purchase calendar addon (Stripe checkout)
-
Confirm calendar and availability (Nylas + Google)
-
Connect Stripe for payouts
-
Review profile information
-
Sign contract
Technical Implementation
Variable: v.onboarding_step_logic
This variable contains a function that determines the current step based on user data:
typescript
console.log("Running onboarding step function with:", c.userXanoData);
if (!c?.userXanoData?.calendar_addon) {
console.log("Returning step: ", 0);
return 0;
} else if (
!c?.userXanoData?.config_id ||
!c?.userXanoData?.cal_confirmed
) {
console.log("Returning step: ", 1);
return 1;
} else if (
!c?.userXanoData?.stripe_account_id ||
c?.userXanoData?.stripe_account_id === ""
) {
console.log("Returning step: ", 2);
return 2;
} else if (!c.userXanoData?.profile_confirmed) {
console.log("Returning step: ", 3);
return 3;
} else {
console.log("Returning step: ", 4);
return 4;
}
Function: onboarding_step_logic
This function shows/hides step UI elements based on the current step:
typescript
const steps = document.querySelectorAll(".step_wrap");
const currentStep = v.onboarding_step;
console.log("Current step is: ", currentStep);
steps.forEach((step, index) => {
const contentWrap = step.querySelector(".step_content-wrap");
const statusTag = step.querySelector(".step_status");
if (index !== currentStep) {
contentWrap.style.display = "none";
} else {
contentWrap.style.display = "block";
}
if (index < currentStep) {
statusTag.classList.add("complete");
statusTag.textContent = "Complete";
}
});
```
## The Problem
### What's Happening:
1. **Page loads** → `c.userXanoData` is `undefined`
2. **`v.onboarding_step_logic` runs** → Returns step 0 (because all data is undefined)
3. **UI displays** → Shows step 0
4. **User data request completes** → `c.userXanoData` now has actual values
5. **`v.onboarding_step_logic` recalculates** → Returns step 1 (correct step based on data)
6. **UI does NOT update** → Still shows step 0
### Console Evidence:
The function runs TWICE on page load:
**First run (data not loaded):**
```
Running onboarding step function with: undefined
=== DEBUG ONBOARDING ===
calendar_addon: undefined
config_id: undefined
cal_confirmed: undefined
stripe_account_id: undefined
profile_confirmed: undefined
======================
Returning step: 0
```
**Second run (data loaded):**
```
Running onboarding step function with: {Proxy Object with actual data}
=== DEBUG ONBOARDING ===
calendar_addon: true
config_id: "0bbaf313-184c-41a9-be71-800921aa0cee"
cal_confirmed: false
stripe_account_id: undefined
profile_confirmed: undefined
======================
Returning step: 1
What I’ve Verified:
-
Backend (Xano) updates correctly - I can see fields like cal_confirmedupdate in real-time -
The variable function calculates the correct step on the second run -
Cookie data shows the correct values after updates -
UI does not re-render when the variable recalculates
What I’ve Tried
-
Using URL query parameters (works but breaks on page refresh)
-
Removing query parameter dependencies from the logic
-
Adding data validation checks to wait for data to load
-
Extensive console logging to track execution
The Question
How do I make the UI function re-run when v.onboarding_step_logic recalculates?
The variable correctly updates from step 0 to step 1, but nothing tells the UI display function to check the variable again and re-render the steps.
Should I be using a different pattern entirely for multi-step flows?
Environment Details
-
Read only link for Wized project: Wized
-
Cookie/storage used:
c.userXanoData
Any guidance on the proper way to handle variable-dependent UI updates in Wized would be greatly appreciated!