---
title: Usage Of g_form.setValue On A Reference Field Without displayValue
description: "Impact Area Performance           Severity High           Affected Element Catalog Client Scripts Client Script Widget Angular Provider UI Action UI Script Rule ID **SN-0383** ## Impact The usage of g_form.setValue() on a…"
url: "https://community-staging.qualityclouds.com/qcdocs/qc/servicenow-rules/usage-of-g_form-setvalue-on-a-reference-field-without-displayvalue/"
updated: "2025-03-21"
category: Rules
---

# Usage Of g_form.setValue On A Reference Field Without displayValue

Impact Area

Performance

 

 

 

 

 

           Severity

High

 

 

 

 

 

           Affected Element

Catalog Client Scripts

Client Script

Widget Angular Provider

UI Action

UI Script

Rule ID

**SN-0383**

## Impact

The usage of g_form.setValue() on a reference field without displayValue causes ServiceNow instance to do a synchronous call to retrieve the display value for the specified record, this extra step can lead  to performance issues.

## Remediation

Avoid the usage of g_form.setValue() without the displayValue parameter.

### Time to fix

10 min

## Code examples

### Noncompliant code

g_form.setValue(‘location’,’67ub8d1b0aaa07b3007a3d3a6b801f5b’);

### Compliant code

g_form.setValue(‘location’,’67ub8d1b0aaa07b3007a3d3a6b801f5b’,’Custom display value’);
