# Expressions for Discount

**URL:** <https://forum.sambapos.com/t/expressions-for-discount/8934>\
**Category:** V5 Question\
**Created:** [January 11, 2016, 8:02am UTC](https://forum.sambapos.com/t/expressions-for-discount/8934 "2016-01-11T08:02:24Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [January 11, 2016, 5:50pm UTC](https://forum.sambapos.com/t/expressions-for-discount/8934/4 "2016-01-11T17:50:32Z")

</div>

I would start here;

> [@Custom Keyboard Codes](http://forum.sambapos.com/t/custom-keyboard-codes/3006):
>
> As of v4.1.61 we can create Custom Keyboards to use with [?prompt] notation, and a Custom Keyboard Widget is available for Entity Screens. For [?prompt] notation, the syntax is: [?\<prompt\>;\<mask\>;\<default value\>;\<flags\>;\<keycodes\>] \<prompt\> is the question or prompt to display \<mask\> is a regular expression to define what type of characters (and how many) are allowed \<default value\> allows for a common value to be pre-entered \<flags\> lets you define the keyboard type and which buttons …

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

---

_[View the full topic](https://forum.sambapos.com/t/expressions-for-discount/8934)._
