tl:dr - I need to store a couple of temporary numbers from a Custom Action on my page while the user is performing a transaction. Is there any reason NOT to put them as fields on the User table, other than it could get really messy in a larger app?
From what I understand:-
- Adalo doesn’t have the concept of a temporary “variable” on a page (future feature)
- Adalo doesn’t allow you to set maximum values in number inputs
To get round this I have the following. All users are logged in to the app.
User enters the code, and we pull back (via Customer Action) a number that is the remaining value on the card.
If it is greater > 0 then the bottom group appears and a slider is used to limit the amount to redeem to value between 1 and that value.
So I need to “store” two values. The maximum amount and the slider value.
The maximum amount can be stored on a hidden input. However, the slider value is not directly addressable via “magic” so I am storing it on a field on the User (zero it on entry and exit from the process).
When trying to hide the “redeem” group, the only options available on the input field are equal or not equal (it is a numeric field). So I can do “not equal to zero” if needed.
However, on the field on the user I have far more options.
That got me thinking about why I wouldn’t just put the remaining amount on the User as well.
But a few other minor questions also…
- Why is the input field in the Group Visibility input shown as if it was a field on the User? If I put a field on the User called “Remaining Amount” I will never know which one it is.
- Why can I do more maths on a database field than an input field?
- Why can’t a slider have an output to an input field?