- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 04:19 AM
Is there a way to prevent submitting a catalog item unless the user clicks a URL in the help text?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 06:03 AM
You can have this approach
1) create a hidden checkbox type variable and place it at the end of catalog form and hide it using UI policy
2) use variable of type Custom and create a widget to show that URL, in HTML of that anchor tag add onclick even and then update that hidden checkbox as true once link is clicked.
3) use onSubmit catalog client script and see if checkbox is true, if yes then allow submission, if not then stop submission
This is the widget syntax to set the variable from widget client controller
api.controller = function($scope) {
$scope.page.g_form.setValue('hiddenVariable', true);
});
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 09:35 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 04:47 AM
Hi Kamil,
Thanks for you response, can you please elaborate the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 04:56 AM - edited 07-16-2025 05:03 AM
@RanjanRP I created a quick draft:
this is how would it look like and if it is not yes, cannot continue...
EDIT: or alternatively in combination with label, mandatory to click this:
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 05:06 AM
@RanjanRP and the label annotation is HTML 😄 so you can use it as you want...
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 05:20 AM
You can use the custom variable type and create new widget or macro which can handle this logic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 06:03 AM
You can have this approach
1) create a hidden checkbox type variable and place it at the end of catalog form and hide it using UI policy
2) use variable of type Custom and create a widget to show that URL, in HTML of that anchor tag add onclick even and then update that hidden checkbox as true once link is clicked.
3) use onSubmit catalog client script and see if checkbox is true, if yes then allow submission, if not then stop submission
This is the widget syntax to set the variable from widget client controller
api.controller = function($scope) {
$scope.page.g_form.setValue('hiddenVariable', true);
});
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader