Expressions for Discount

Hello Everyone,

I am working on a discount button which allows only 1-30 percent discount. In the tutorial for the discount button I see an expression which is for 1-10%, it is: [?Discount Rate:[1-9]|10 It]

This works nicely for 1-10 however I am unsure how to accept 1-30%. Can anybody please help with this.

Thank you

Try [1-9] | [1-2][0-9] | 30

1 Like

Does not work when I do: [?Discount Rate:[1-9] | [1-2][0-9] | 30]

It does not let me enter double digits.

I would start here;

Although doesn’t mention setting a maximum.
Perhaps it was setting default value of 10 and the mask only allowing single digit…
[?Prompt] expression offers these options [?<prompt>;<mask>;<default value>;<flags>;<keycodes>]

If you made it a two stage flow with the prompt in an execute automation command in value fields you could define all sorts of prompts should a value be entered wrong using constraints on the command value lide [:CommandValue] > 30 on an ask question prompt saying discount only possible up to 30% and then your action to apply discount would have constraint of [:CommandValue] < 30

Try add ? After [1-9]?

Update: I got it backword. It has to have double digits first.

[1-2][0-9] | 30 | [1-9]

1 Like

When I do this I am able to enter double digit discounts but not 0-9. Also not 30, only up to 29.

I need to be able to enter 1-30 single or double digits. Any help - really appreciate it,

LOL, Sorry, try remove space :wink:
[1-2][0-9]|30|[1-9]

UPDATE: Just test it

2 Likes