Want to apply the Regex to the field based on the condition through UI Policy

Community Alums
Not applicable

Hi All, 

 

Having a requirement that want to apply the Regular Expression to the field based on the condition through UI Policy in the order guide. 

having one variable set in the order guide in that the two variables are *First Name and *Last Name 

there are two conditions are here like check boxes 

1. Existing user(AD)

2. New user 

here come the requirement that *If we select the Existing user the First and last name will get to be Auto populated read-only then the Regex will not apply on that and gets error. So Not to apply for this Existing user 

If we select the New user only the regex has to apply 

so for that trying with ui policy with script. Need suggestion on this.

 

 

 

Regards, 

Vinod.

 

 

 

 

 

 

 

 

 

 

 

 

3 REPLIES 3

SJ4
Tera Contributor

Hi 

Here you will have to use two UI policies . 

  1. UI Policy 1 : Existing User is true 
  • Select the advance view and use the run script block to set your values and make them read only in the true script box. 
  • Also select reverse if false and in the false script bock clear all field values i.e first name and last name and make them read -only false. 

    2.UI Policy 2 : New user is true

  • Select the advance view and use the run script block(true condition) to set your regex validations.

 

Community Alums
Not applicable

HI, 

 

Can you help me with the syntax for this to validate the Regex.

 

Thanks, 

Vinod.

Hi, 

Regex has different validations for different use cases - could you please specify the use case i.e. what kind of validation you want to put on that field !

 

Regards, 

SJ