How to make a field not visible or editable by requester

Community Alums
Not applicable

Hi,

I have a requirement. 

Planned Start Date: Date Field, Required Field, (Not editable/visible by requestor. Fullfillment team can edit on RITM or SCTASK form).

Kindly help.

Regards

Suman P.

1 ACCEPTED SOLUTION

SwarnadeepNandy
Mega Sage

Hello @Community Alums,

One possible way to achieve this requirement in ServiceNow is to use a combination of UI policies and ACLs. UI policies can be used to make the Planned Start Date field required and not visible by the requestor on the service catalog item form. ACLs can be used to make the field not editable by the requestor on the RITM or SCTASK form, but allow the fulfillment team to edit it.

To create a UI policy for the Planned Start Date field, you can follow these steps:

  • Navigate to Service Catalog > Catalog Definitions > Maintain Items and open the catalog item that you want to apply the UI policy to.
  • Click the UI Policies related list and then click New.
  • Fill in the fields as follows:
    • Name: A descriptive name for the UI policy, such as “Hide Planned Start Date for requestor”.
    • Active: Check this box to enable the UI policy.
    • Reverse if false: Check this box to apply the opposite actions when the condition is false.
    • Order: A number that determines the order of execution of the UI policy. A lower number means higher priority.
    • Condition: A script or filter condition that determines when to apply the UI policy. For example, you can use gs.getUser().isMemberOf('fulfillment_team') to check if the user belongs to the fulfillment team role.
    • UI Type: Select Mobile or Desktop or Both, depending on where you want the UI policy to apply.
  • Click Submit to save the UI policy record.
  • Click the UI Policy Actions related list and then click New.
  • Fill in the fields as follows:
    • Name: A descriptive name for the UI policy action, such as “Make Planned Start Date required and hidden”.
    • Action: Select what action to perform on the field, such as Mandatory or Visible.
    • Value: Select true or false, depending on whether you want to make the field mandatory or visible.
    • Field name: Select the field that you want to apply the action to, such as Planned Start Date.
  • Click Submit to save the UI policy action record.

To create an ACL for the Planned Start Date field, you can follow these steps:

  • Navigate to System Security > Access Control (ACL) and click New.
  • Fill in the fields as follows:
    • Name: A descriptive name for the ACL, such as “Read-only Planned Start Date for requestor”.
    • Operation: Select read or write, depending on what permission you want to control.
    • Table: Select the table that contains the field, such as Requested Item [sc_req_item] or Catalog Task [sc_task].
    • Field: Select the field that you want to apply the ACL to, such as Planned Start Date.
    • Type: Select record or field, depending on whether you want to apply the ACL at the record level or field level.
    • Script: A script that returns true or false, depending on whether you want to grant or deny access. For example, you can use !gs.getUser().isMemberOf('fulfillment_team') to deny write access for users who are not in the fulfillment team role.
  • Click Submit to save the ACL record.

For more information on how to work with UI policies and ACLs in ServiceNow, you can refer to these resources:

Hope this helps.
 
Kind Regards,
Swarnadeep Nandy

View solution in original post

1 REPLY 1

SwarnadeepNandy
Mega Sage

Hello @Community Alums,

One possible way to achieve this requirement in ServiceNow is to use a combination of UI policies and ACLs. UI policies can be used to make the Planned Start Date field required and not visible by the requestor on the service catalog item form. ACLs can be used to make the field not editable by the requestor on the RITM or SCTASK form, but allow the fulfillment team to edit it.

To create a UI policy for the Planned Start Date field, you can follow these steps:

  • Navigate to Service Catalog > Catalog Definitions > Maintain Items and open the catalog item that you want to apply the UI policy to.
  • Click the UI Policies related list and then click New.
  • Fill in the fields as follows:
    • Name: A descriptive name for the UI policy, such as “Hide Planned Start Date for requestor”.
    • Active: Check this box to enable the UI policy.
    • Reverse if false: Check this box to apply the opposite actions when the condition is false.
    • Order: A number that determines the order of execution of the UI policy. A lower number means higher priority.
    • Condition: A script or filter condition that determines when to apply the UI policy. For example, you can use gs.getUser().isMemberOf('fulfillment_team') to check if the user belongs to the fulfillment team role.
    • UI Type: Select Mobile or Desktop or Both, depending on where you want the UI policy to apply.
  • Click Submit to save the UI policy record.
  • Click the UI Policy Actions related list and then click New.
  • Fill in the fields as follows:
    • Name: A descriptive name for the UI policy action, such as “Make Planned Start Date required and hidden”.
    • Action: Select what action to perform on the field, such as Mandatory or Visible.
    • Value: Select true or false, depending on whether you want to make the field mandatory or visible.
    • Field name: Select the field that you want to apply the action to, such as Planned Start Date.
  • Click Submit to save the UI policy action record.

To create an ACL for the Planned Start Date field, you can follow these steps:

  • Navigate to System Security > Access Control (ACL) and click New.
  • Fill in the fields as follows:
    • Name: A descriptive name for the ACL, such as “Read-only Planned Start Date for requestor”.
    • Operation: Select read or write, depending on what permission you want to control.
    • Table: Select the table that contains the field, such as Requested Item [sc_req_item] or Catalog Task [sc_task].
    • Field: Select the field that you want to apply the ACL to, such as Planned Start Date.
    • Type: Select record or field, depending on whether you want to apply the ACL at the record level or field level.
    • Script: A script that returns true or false, depending on whether you want to grant or deny access. For example, you can use !gs.getUser().isMemberOf('fulfillment_team') to deny write access for users who are not in the fulfillment team role.
  • Click Submit to save the ACL record.

For more information on how to work with UI policies and ACLs in ServiceNow, you can refer to these resources:

Hope this helps.
 
Kind Regards,
Swarnadeep Nandy