getcurrentstep
## Function: Get current step
This function allows you to retrieve the unique numerical identifier (code) of the step that is currently active or open within a Stepper UI element. This is useful for understanding where a user is in a multi-step process, enabling you to build dynamic user experiences based on their progress.
### Input
- Stepper UI Element: This is the specific Stepper component on your page from which you want to get the current step. You must select an existing Stepper UI element from your application.
### Output
- Result: The numerical code of the currently active step. This value will be stored in a variable named 'CURRENT_STEP' by default, but you can choose a different variable name to store this result.
### Execution Flow
### Real-Life Examples
Here are some practical ways you can use the "Get current step" function in your application:
#### Example 1: Displaying User Progress in an Onboarding Flow
Scenario: You have an onboarding wizard for new users, structured as a Stepper with several steps (e.g., "Welcome", "Profile Details", "Preferences", "Complete"). You want to display the current step number to the user or trigger specific actions based on their progress.
- Inputs:
- Stepper UI Element:
Onboarding\_Wizard\_Stepper
(the name of your Stepper component) - Result:
Current\_Onboarding\_Step\_Number
(a new variable to store the output)
- Stepper UI Element:
- Result: The variable
Current\_Onboarding\_Step\_Number
will contain the numerical code of the step the user is currently viewing (e.g.,1
if they are on "Welcome",2
for "Profile Details", etc.). You can then use this variable to update a progress bar, show conditional text, or enable/disable navigation buttons.
#### Example 2: Conditional Form Section Display
Scenario: You've built a complex application form using a Stepper, where different sections of the form are displayed on different steps. You need to know which step the user is on to dynamically show or hide specific input fields or information panels.
- Inputs:
- Stepper UI Element:
Loan\_Application\_Stepper
- Result:
Active\_Form\_Section\_ID
- Stepper UI Element:
- Result: The variable
Active\_Form\_Section\_ID
will hold the numerical code of the active step. For instance, ifActive\_Form\_Section\_ID
is3
, you can set up rules in your application to display the "Financial Information" section and hide other sections, ensuring the user only sees relevant fields for their current progress.
#### Example 3: Saving and Resuming Multi-Step Processes
Scenario: Users might not complete a multi-step process (like a checkout or a complex survey) in one sitting. You want to save their progress and allow them to resume exactly where they left off.
- Inputs:
- Stepper UI Element:
Checkout\_Process\_Stepper
- Result:
Last\_Saved\_Checkout\_Step
- Stepper UI Element:
- Result: The variable
Last\_Saved\_Checkout\_Step
will store the numerical code of the step the user was on when they last interacted with the process (e.g.,2
for "Shipping Address"). When the user returns, you can use this stored value to automatically set theCheckout\_Process\_Stepper
to that specific step, providing a seamless resume experience.