- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 04:57 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 05:26 AM
you need to have a custom integer type field to store the count and then increment it from server side each time button is clicked
UI Action condition
Your Existing UI Action Condition && current.u_count <= 5
Script Update
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-07-2025 05:08 AM - edited 07-07-2025 05:15 AM
Hello @aamir khan ,
Please create a Script Include that accepts the current record’s sys_id as an input. Inside the Script Include, use the Glide Audit History table to check how many times the Assignment Group was set to "Help Desk"based on sys_id of record.
If the count is 5 or more, return false; otherwise, return true.
Then, call this Script Include from the "Condition" field of the UI Action. Based on the returned value:
If true, the button will be visible.
If false, the button will be hidden.
Please try this approach — it should work as expected.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 05:16 AM
Here is proposed solution from my end:
1. Use a custom counter field - This avoids relying on logs or history.
2. Update the UI Action Logic
3. Add the condition to UI Action - This will help to hide the button automatically once the limit is reached.
✔️ If this solves your issue, please mark it as Correct.
✔️ If you found it helpful, please mark it as Helpful.
—
Shubham Jain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 05:26 AM
you need to have a custom integer type field to store the count and then increment it from server side each time button is clicked
UI Action condition
Your Existing UI Action Condition && current.u_count <= 5
Script Update
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-07-2025 08:10 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