How to make a set of variables visible and editable to an approver on a catalog item after it is submitted for approval?

abcmh
Giga Contributor

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?

3 REPLIES 3

Inactive_Us1289
Mega Contributor

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


Prashant Sharm7
Tera Contributor

Have you got the answer for this from somewhere, If yes, please revert.

PrashantLearnIT
Giga Sage

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://docs.servicenow.com/bundle/quebec-servicenow-platform/page/product/service-catalog-managemen...l

 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
********************************************************************************************************