Solved

Regular Expressions (FSM)


Userlevel 5
Badge +12

Does anyone know how regular expressions work with FSM? As in, how do you specify the (input)value that needs to be validated and how do you specify the ‘Output format’? 

There are some examples which sort of make sense, but it is to little to fully understand it. 

 

 

icon

Best answer by Lee Pinchbeck 6 May 2020, 16:35

View original

4 replies

Userlevel 7
Badge +24

Hi,

The input to be validated would be a field on an FSM screen. In the UI designer, if you highlight a field and look at the properties there is a regex ID setting. If you set this to one of the regex ID’s you have created in the system then when a user inputs something in to this field it will be validated against that regex.

The output format is used to then alter the input to a standardised format so that all entries follow this same form. For instance ensuring a phone number follows the form of +##(#) ### ### so if someone enters just nine numbers it can then add the + () and spaces to match that form.

Kind regards,

Lee Pinchbeck

Userlevel 5
Badge +12

Hi Lee,

Thanks a lot for this info. And how about when I want to output a date differently then the user inserted? I would like to convert for example a date (e.g. the date 4th of may 2020) which is inserted as 04-05-2020 to 2020-05-04. Is this also possible?

And do you know if there is any documentation? Because as you can see in the demo data you can have very particular setting in ‘value’ and ‘output format’.

Kind regards

Jos de Pijper

Userlevel 7
Badge +24

Hi Jos,

I think the output is more suited to manipulating the information that has been input and adding individual characters (such as the phone number in your example that adds a 1 on the front and  - between the sets but keeps the numbers entered by the user) rather than converting input to some other form (as in changing a word input to an equivalent numerical value as in your date example).

I do not believe there would be IFS FSM specific documentation for this as it is regular expression notation that is being used which is generic coding format that FSM allows you to enter rather than something designed for FSM itself.

You should be able to find advice, traning and guidance online as to how to format these expressions. As long as it is a valid regex and output FSM should then allow it and use it correctly.

Kind regards,

Lee Pinchbeck

 

Userlevel 5
Badge +12

Hi Lee,

Thanks for your support. Since I am coming from a functional role, I was not aware of the fact that Regex is actually some kind of a code language. I just figured it was something FSM specific. 

It makes sense though that when it is some open source logic, that there is no further explanation of the feature in FSM. 

I now found this website https://regexr.com/ which helps explain how regex actually works. 

Thanks a million!

Reply