Validation on Multi Row variable set (same role cannot be allowed).

Shidhi
Tera Contributor

Hi @Ankur Bawiskar 

 

Under a multi-row variable set (environment_selection) two select box fields i.e., select_environment , select_role is present.

 

A requester could request different roles for the same environment this can't be allowed.

For ex. I could select both the user and the viewer roles for ARCS UAT. Please check below.

 

Shidhi_0-1716404334567.png

 

However, only one role per environment is allowed to be selected.

If multiple roles are selected for the same environment, an alert must come saying that the selected environment is already added and clear the chosen environment field value.

 

I'm not sure how to check two variables. Please help me with this. 

 

Please help me with this.

 

Thank you!

 

 

 

 

 

1 ACCEPTED SOLUTION

@Shidhi 

what type of client script it is?

onSubmit on catalog item right?

try using alert instead of g_form

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

10 REPLIES 10

@Shidhi 

what type of client script it is?

onSubmit on catalog item right?

try using alert instead of g_form

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader