Hey we are using the entity node to extract the amount for payment but we want to avoid accepting -ve amount and zero amount. we are using currency type in the entities. how can we handle such use cases without using the script to validated the amount.
Hello @rohit.marathe1 ,
We do have entity rules for entity nodes which can be used for some control.
for example: maxDigits rule can be used to stop from accepting 0 as value. But this may not cover the -ve number case.
Other ways to achieve this will be to use custom entity where you can set regex to control the input, as well as using a script node to configure the conditions for input value.
The Number entity contains a range entity rule that can be used to enforce positive numbers only. We can replicate that rule to the Currency entity. Raise a ticket for that.
But do consider that a negative entry might deserve a special error message instead of a general one, so using a connection to transition to a specific message might well be a better experience for the user. The specific response would confirm to the user that they have the right format, just a negative number, and so it is easier to understand what has gone wrong. Using an advanced message provides the script block to clear the old entity value.
Do NOT use a regex because it is inherently inflexible for conversation. Numbers, especially, can be said in many different styles that are practically impossible to handle in regex.