Skip to main content
16-Pearl
June 14, 2022
Solved

How to use valid range constraint for string??

  • June 14, 2022
  • 1 reply
  • 1774 views

Hi All,

 

I would like to know, how to use "valid range" constraint for String attribute.

I've defined: From aa To bb.

As a result, I'm able to create business object that has 'ac' as a value of attribute, but 'ca' isn't acceptable.

 

Could somebody explain it in simple words?

Many thanks in advance.

 

Best answer by HelesicPetr

Hi @Gucio 

it is similar to numbers.

range from 11 to 22  is not just 11, 12, 21, 22 but it is 11-19 and 20 - 22

 

an alphabet range is a-z for one position of a character. same as a number 0-9. 

 

Is it more clear? 

 

With range "aaa - ccc" you can still write "cbz" because it is in specific range. 

 

PetrH

 

1 reply

HelesicPetr
22-Sapphire II
22-Sapphire II
June 15, 2022

Hi @Gucio 

What do you expect?

 

Your result definition is from aa to az and from ba to bb 

 

if you expect a range aa, ab, ba, bc then you should use different constraint for example the Legal value list

HelesicPetr_0-1655275184048.png

 

Hope this help

 

PetrH

Gucio16-PearlAuthor
16-Pearl
June 15, 2022

Hi Petr,

 

I'm still not able to catch it.

I was expected to achieve result similar to your example with Legal Value.

 

I was thought, that giving boundaries starting from 'aa' and finishing at 'bb' will allow user to fill one of four options: 'aa' or 'ab' or 'ba' or bb'. Why 'az' and 'ba' did you mention as result?
Going deeper, making valid range form 'aaa' to 'ccc' in my mind should allow typing 'aaa' or 'aab' ..... up to 'ccc'.

Would you be so kind as to clarify the answer?

 

Thx in advance.

HelesicPetr
22-Sapphire II
22-Sapphire II
June 15, 2022

Hi @Gucio 

it is similar to numbers.

range from 11 to 22  is not just 11, 12, 21, 22 but it is 11-19 and 20 - 22

 

an alphabet range is a-z for one position of a character. same as a number 0-9. 

 

Is it more clear? 

 

With range "aaa - ccc" you can still write "cbz" because it is in specific range. 

 

PetrH