Issue
On the Now platform, we have the option of adding variable editors in tables extended from task. For more information on how to set one, please see the documentation: Configure the default variable editor for a task-extended table
Here, we learn how to set the variables read-only that get displayed in the variable editor in the form view of these tables.
Resolution
Let's consider "Change Request" as one of the task-extended tables.
- Open any active change request record and under the header "Additional Options" (or right-click), go to Configure > Form Layout.
- Look for an out-of-the-box setup "Change Variable Editor" (as shown in the below screenshot):
- This is actually a UI Formatter. add this editor to your form in the desired section.
- Back in the form, this variable editor will display variables of the record producer (from where this change request was created in the first place).
- Navigate to Service Catalog > Record Producers. Look for the respective record producer and open it.
- In the Variables related list, you will see the list of variables defined (and of course, these hold the values in the existing change request).
- Open the variable that you prefer to keep read-only for certain users (can be all the variables, as per business requirement).
- Check whether you have the Write roles field available. If not, then add this field from the form layout configuration (Configure > Form Layout).
- This field gives you the option of which set of roles you want the users to only have "write" access on this variable.
Example:
- There is a business requirement that requires all non-admin users to have read-only access to the variable in the variable editor.
- For that, you would select "admin" as the right role for "Write roles".
- Once added (in the Selected section), click Done to save the variable form.
- Try impersonating (or logging in as) a non-admin user and opening the same change request (make sure the user has access to the table and their fields).
- You will notice that the variable is in "read-only" mode in the variable editor.
- Sample screenshot:
Related Links
Please refer to our product documentation: Apply permissions to a service catalog variable