Can we put validation for multi row variable set for mandatory variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 03:06 AM
Hi All,
I need help with MRVS validation.
We have multiple variable inside one of the multi row variable set. Now the issue is if user do not pay attention and forgets to fill the few mandatory fields. There is no way to stop the submission the form. Is there any way to put the validation to check for mandatory fields before submitting the form?
Regards,
Shivani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 11:43 AM
Just make the desired MRVS variable(s) mandatory, then the user won't be able to add a row without supplying a value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 10:52 PM
Hi Brad,
MRVS is filled based upon the value selected in package type. Even though I made the MRVS(selected package type) as mandatory. It is still not check inside variables which are mandatory and letting the form submit.
MRVS contain few variables which are auto filled based on selection of package type. But, there are few other fields which has to be filled manually by user, for which user needs to click on that mrvs edit button and fill the values manually. In this scenario only, user is forgetting to fill the mandate values and the form is getting submitted.
Please advise something which can resolve this validation. @Brad Bowman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2023 04:42 AM
What I suggested was to make one or more actual variables within the MRVS mandatory. Use the checkbox on the variable definition form to do this. Your script should still be able to auto-fill the row, but when the user edits the row they will not be able to save the changes without populating the mandatory variable(s). Try this first as it is a much easier solution. If it's possible that the user doesn't even edit a row, then this probably won't work to prevent request submission.
You could also create an onSubmit script that applies to the Catalog Item, not the MRVS to check the entire value of the MRVS and alert if there are any rows with an empty value for certain variable(s), but since you are doing this in Service Portal, this script will be unable to prevent submission of the request if an empty value is found as it is happening at the same time, so the request will still get submitted. To work around this in your scenario one solution is to create another Catalog Item variable that can be hidden or read-only on the request form. This variable could be a checkbox, yes/no, or single line text. It would be blank initially and mandatory. It would get checked/populated by an onSubmit script that applies to the MRVS. So when a new row is created or edited this script would run. If every mandatory variable in the current row, and other rows in the MRVS are populated, then this new Catalog Item variable can be populated. In this way the request cannot be submitted until all of the mandatory MRVS variables in all rows are populated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 03:51 PM
Hi @shivani39 ,
Make the whole multi row variable set you as mandatory. This will make sure the users won't be able submit the form, without going inside the MRVS and updating the mandatory variables.
Please mark helpful/Like, if the solution is in line with your expectation.
Regards,
Gagan k