How to make ui formatter variables editable and mandatory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 08:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 09:17 PM
Hello @vikaskv,
Kindly refer to the community post below, as it may be helpful for your requirement:
https://www.servicenow.com/community/itsm-forum/make-variable-editable-in-variable-formatter/m-p/261...
Please mark my solution as helpful and accepted for future reference.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 09:24 PM
Hey anshul _goyal as per requirement i need to create ui action button based on click of button the fields should be mandatory and editable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 09:38 PM
Then you can create a client callable UI Action and under the script use the below code based on your requirement:
g_form.setReadonly('variables.variableName', false);
g_form.setMandatory('variables.variableName', true);
Please mark my solution as helpful and accepted for future reference.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 09:21 PM
Hello @vikaskv ,
Create catalog UI Policy and add you required condition to make variables mandatory or editable. Just to make sure, select "Applies on target table".
Please find screenshot for your reference -
Thank you.