I want to apply validations on users input uppercase , lowercase, spaces, camel case everything at once.

0
I want to apply validations on users input ' uppercase , lowercase, spaces, camel case ' everything at once. User can give input as he/she wants it can be in uppercase lowercase can give spaces but at the end it will be converted into uppercase and removes the unwanted spaces . how to apply different validations at once in a microflow please guide . also please guide what can be other validations error which can happen in a website
asked
3 answers
0

If I understand your question you don’t mean validations, but you want to correct your data. In that case you can use the string functions in a “Change Object” activity, like as follows.

All to upper case and trim whitespace at the beginning and at the end of the string:

toUpperCase(trim($Object/Attribute))


All to upper case and remove all spaces from string:

toUpperCase(replaceAll($Object/Attribute, ' ', ''))


All to upper case and remove all spaces, tabs, line breaks from string:

toUpperCase(replaceAll($Object/Attribute, '[\s]', ''))

 

answered
0

Hi

Use can use toUppercase functionality inside you microflow activity 

Step1 : Create a string variable, which get the User input by the object it is passed from the page

Step2: From the Created variable use toUppercase($input/string)

https://docs.mendix.com/refguide/string-function-calls#3-touppercase

The above link might help you in detail

answered
0

I would highly recommend following the “become a rapid developer” learning path, and specifically this part:

Validation in Microflows

Validation in microflows is a basic functionality that you will be using in virtually every application that allows user input (and in some that don't), so it's definitely worth learning how to do it properly.

As for other validation you might want to do, depending on your usecase:

  • Attribute is not empty, but also is not an empty string (‘’). 
  • Attribute does not contain certain characters (for instance, if you need to send your data to another system that doesn't allow certain characters, like %)
  • Attribute value is unique
  • Etc.
answered