Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Incident form values are clearing out once form saved

Phanideepthi
Tera Contributor

Hi All,

 

We have worked on capturing the business domain and business function values from the CI selected on the incident form through the below link

https://www.servicenow.com/community/incident-management-forum/populate-the-domain-values-when-a-ci-...

 

The solution is working fine but now the values are getting cleared out once the form is saved. Help me to understand why they are clearing out.

 

Thanks in advance

5 REPLIES 5

Anand2799
Tera Guru

Hi @Phanideepthi ,

 

It's clearing out on load, because you are clearing out value of fields without isLoading logic.

Add this to your client script in start : 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading) {
      return;
   }

   if(!newValue) {
    g_form.clearValue('description');
   }
}

 

Thanks

Anand