Page 1 of 1

number and validating property

Posted: Tue Oct 27, 2020 10:53 am
by ThomasDeschamps
Hi there,
i encountered a misleading documentation with the validation of a "number" property in Scripter 2020. I also found it was present in previous version (2019 at least)
:

Number : Is non-empty and contains only decimal digits

In fact, you can only type a positive integer number : no negative, no float.
But if you pass a float or a negative using a variable or a script, it work!

Re: number and validating property

Posted: Tue Oct 27, 2020 5:47 pm
by freddyp
The behavior you describe has always been like that. If you want to allow negative number and/or floats during flow design (that is different than at execution time), you should choose "Single-line text" in combination with "Validation - Custom". In the entry point isPropertyValid (legacy) or in validateProperties (Node.js) you then use a regular expression to validate the user's input.