Name Field (free text box) is clearing when conditions are still true

ericmoya
Tera Contributor

ServiceNow Washington DC: I created a UI Policy for a name field (free text box) added to the incident form. However, when I create or update an incident, the value in the name field is cleared. I need the value in the name field to remain as long as the condition is true, and to be cleared when the condition is false. I have tried various combinations of client scripts and UI Policies, but nothing is working.

Table
-Incident [incident]
Condition (or)
-Caller | contains | Vendor
-Caller | contains | Store

UI Policy Action:
-Field Name u_name | Mandatory: True | Visible | Read only: Leave Only | Cleared field value: checked

3 REPLIES 3

palanikumar
Mega Sage

Hi,

For your requirement, clear the Name field using Client Script. On Change of Caller, check whether it does not match condition and clear it if true.

Thank you,

Palani

Thank you,
Palani

Ankur Bawiskar
Tera Patron
Tera Patron

@ericmoya 

Do the reverse i.e. do this

Condition (AND)
-Caller | DOES NOT contains | Vendor
-Caller | DOES NOT contains | Store

UI Policy Action:
-Field Name u_name | Mandatory: False| Visible: False | Read only: Leave Only | Cleared field value: checked

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@ericmoya 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader