I’ve just had an idea for a new action that would force a value to be between two min and max bounds. For example, Data Manipulation > Clamp which would take 3 parameters:
a location containing the value to clamp
a min bound (inclusive)
a max bound (inclusive)
Full text displayed would give something like Clamp location between min and max. For example, clamping between 5 and 10 would:
store 5 in the location if it contains anything less than 5
do nothing if the location contains a value >= 5 and <= 10
store 10 in the location if it contains anything greater than 10
This would be doable on anything comparable such as Integer, Number, Interval and Datetime types.
For situations where you don’t want to hinder the operator with button clicks and error messages, I think this would save a couple ifs and would allow to build apps faster. What do you think?
Thanks for these two workarounds! I didn’t think of using MIN() and MAX() this way and I’ll keep that one mind. The main issue I have with these two solutions is readability (especially for people who aren’t into expressions that much). But at least it works!