How to Create a Form with Repeating Fields Based on Yes/No Selection in ServiceNow?

Ashok_Bandla
Tera Expert

Hi everyone,

I need help creating a form in ServiceNow with the following requirements:

  1. Variable 1: Single-line text input
  2. Variable 2: Single-line text input
  3. Variable 3: Single-line text input
  4. Variable 4: Yes/No selection

The goal is that if Variable 4 is set to "Yes," the form should repeat Variable 1, Variable 2, and Variable 3 and 4 to allow the user to enter additional data. This repetition should continue until Variable 4 is set to "No."

How can I achieve this in ServiceNow, either through form design or scripting?

Thanks in advance for any guidance!

 

7 REPLIES 7

Hello @Ashok_Bandla , this is something different add row hiding you aren't working on ? 

 

What is the requirement in this script ? With MRVS it doesn't works like that. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

Ankur Bawiskar
Tera Patron
Tera Patron

@Ashok_Bandla 

how are you maintaining the count of how many times user selected Yes?

You can have a single line text variable and ask user how many times he/she will be entering the information

Then have a MRVS and let them add 3/4 rows

Then you know the total count in your single line text variable, get MRVS, parse and check how many rows are there

If both are not same then throw error.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Shivalika
Mega Sage

Hello @Ashok_Bandla 

 

 

Please confirm if you checked my answer. Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for my efforts and also it can move from unsolved bucket to solved bucket. 

 

Regards, 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeE