How to make a set of variables visible and editable to an approver on a catalog item after it is submitted for approval?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2017 08:01 AM
Hello,
I have a catalog item in the service catalog that has a set of variables that can only be edited by the approver at the time of approval.
These variables are not visible to the requestor when he or she creates the request. Once the catalog item is submitted for approval to the approver,
the variables should be visible to the approver and he has to fill out all these field before he can approve.
Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2017 12:43 AM
Hi,
You can do it using catalog client scripts. Write a script include to check if logged in user is approver or not. Return the value in your catalog client script and based on that you can hide/display variables on RITM or TASK.
Thanks,
Tamoghna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2022 11:15 PM
Have you got the answer for this from somewhere, If yes, please revert.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2022 11:30 PM
Hi, abcmh,
You can simply add the Variable Editor to the RITM form.
Open any RITM record and right-click on header and configure=>form layout and bring in the variable editor from available items and save.
See:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0538897
You can make certain variables read-only using an OnLoad Client Script and using for example:
g_form.setVariablesReadOnly(true); //make all variables read-only
g_form.setReadOnly('variable_name_here', true); //but allow edit of this one
Preferably use a Catalog UI Policy (no coding required :)) with 'Applies on Requested Items' set to True
g_form.setReadOnly('variable_name_here', false);
Best Regards,
Prashant
If my answer helped you in any way, please mark this answer as helpful and correct.
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.
********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect
Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************