IF no user id entry found on reference variable we need to show message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
Hi Team,
We currently have two variables in the form:
- Select User – a reference variable pointing to the User table
- User ID – a single-line text variable
The expected behavior is as follows:
When the user information entered in Select User is not found, the system should display the following error message:
“User BC ID not found, please introduce data manually.”After displaying this message:
- The Select User reference variable should be hidden
- The User ID text variable should be displayed, allowing the user to enter the details manually
Please help me to achieve the requirement.
Thanks,
Pujitha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
Hi @pujitha K
As per my experience, the Reference field does not work like this. If a user is not found, it will not show any record.
What you can do instead is create a new checkbox variable, for example “User Not Found.” If this is selected, you can redirect the user to another record producer, page, or catalog item to handle the case appropriately.
I had a similar situation when working with the Location table, and this approach worked well.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
This doesn't look like a valid business requirement.
Your variable is reference to sys_user means whatever record the user selects that user is available in sys_user
Then that message won't be shown
I will request to discuss this requirement with your customer
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
Hi @pujitha K ,
Its not that perfect requirement .
Still you can try this way.
1) Create a UI policy /Onload catalog client script
which will hide User_id single line text from form during onload.
2. Create a OnSubmit Catalog Client script to validate whether select_user variable having value or not . If no value , make User ID mandatory.
Note : Select User should not be Mandatory variable, else, this solution will not work.
