I’ve created a nice hour selector and I have a small, final issue.
Here is what I have:
an input box (middle) with dynamic value inside: a state (type number)
text elemnent with “-” sign in it that has an workflow action on it to decrease -1 the state (below)
text element with “+” sign in it that has an workflow action on it to increase +1 the state (below)
The iterations work fine when I press the signs, BUT the only problem i have is I want to put a limit to the number of hours (that gets iterated in the box by the signs) a user can reach. So let’s say never below one and maximum 8. how do i do that?!
This is a simple conditional check you need to add to your workflow actions. For the minus button, you want it to only decrease the state when the current value is greater than your minimum. For the plus button, you only want it to increase when the current value is less than your maximum.
On your minus text element workflow where you decrease the state by 1, add an “Only when” condition that says “coworkingspace2’s counter_hours_days_state is greater than 1”. This prevents it from going below 1.
On your plus text element workflow where you increase the state by 1, add an “Only when” condition that says “coworkingspace2’s counter_hours_days_state is less than 8”. This prevents it from going above 8.
That way the buttons will only work within your defined range of 1 to 8 hours. The workflows simply won’t execute if the conditions aren’t met, so users can’t accidentally go outside those limits.