---
title: Usage Of g_form.setValue On A Reference Field Without displayValue – Portal Widget clientScript
description: "Impact Area Performance Severity High Affected Element Widget ## Rule ID **SN-0384** ## 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…"
url: "https://community-staging.qualityclouds.com/qcdocs/qcr/rules/usage-of-g_form-setvalue-on-a-reference-field-without-displayvalue-portal-widget-clientscript/"
updated: "2025-03-21"
category: Rules
---

# Usage Of g_form.setValue On A Reference Field Without displayValue – Portal Widget clientScript

Impact Area

Performance

           Severity

High

           Affected Element

Widget

## Rule ID

**SN-0384**

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