---
title: Usage Of g_form.setValue On A Reference Field Without displayValue – UI Policy scriptTrue
description: "Impact Area Performance Severity High Affected Element UI Policy ## Rule ID **SN-0385** ## 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…"
url: "https://community-staging.qualityclouds.com/qcdocs/qc/servicenow-rules/usage-of-g_form-setvalue-on-a-reference-field-without-displayvalue-ui-policy-scripttrue/"
updated: "2025-03-21"
category: Rules
---

# Usage Of g_form.setValue On A Reference Field Without displayValue – UI Policy scriptTrue

Impact Area

Performance

           Severity

High

           Affected Element

UI Policy

## Rule ID

**SN-0385**

## 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’);
