When I enter values in my task form and save, the values get cleared after saving.

CharanV66187530
Kilo Guru

Details:
I have not added any client scripts, UI policies, or server scripts that clear or reset the values. Despite this, the variables are still being cleared automatically after saving.

Request:
Can you help me understand why this is happening and how to fix it?

1 ACCEPTED SOLUTION

CharanV66187530
Kilo Guru

Thank you to everyone for your responses.

 

Someone on my project created a section and added a variable editor to the task form. As a result, we were unable to save the variable values. After deleting that section, everything is now working fine.

View solution in original post

9 REPLIES 9

Mark Manders
Tera Patron

Please provide more information. There could be a number of things wrong. Your description is to limited and a response like 'it was working before' doesn't help in pinpointing to the issue.

What form? Custom or OOB? Which table? What do the logs say? What did you already check? What happened between when it was working and now?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Hi @Mark Manders ,

1. We have a UI policies that makes variables read-only on both the sc_task and RITM forms.

2. I have a few mandatory variables on the sc_task form. When I set values and save the form, the values are not saved — they revert back to their previous state.

3. To troubleshoot, I deactivated those two UI policies.

 

The script on the UI policy is: g_form.setVariablesReadOnly(true);

Tanushree Maiti
Tera Patron

Hi @CharanV66187530 

 

In one of my project, for a catalog, we faced the same issue once business reported it. That time root cause was "Clear the variable value"  was selected in Catalog policy UI action. Once we unchecked it, it worked fine.

 

sample screen shot:

TanushreeMaiti_0-1791466293782.png

 

Check if  you have same root cause - KB1064636 Variable editor field value cleared on catalog task record 

 

Resolution

 

To stop the variable editor from clearing the field value, uncheck the **Clear the variable value** field on the Catalog UI Policy Action.

1. Navigate to the Catalog UI Policy Action for the catalog item that the task was created from.
2. Open the relevant Catalog UI Policy Action record.
3. Uncheck the **Clear the variable value** field.
4. Save the record.

After saving, the value will no longer be cleared from the variable editor and will display correctly.

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

Thank you for your response. We don't have any UI policy actions related to 'clear value' or 'value action.' It might be a system issue, but I'm not certain.

CharanV66187530
Kilo Guru

Thank you to everyone for your responses.

 

Someone on my project created a section and added a variable editor to the task form. As a result, we were unable to save the variable values. After deleting that section, everything is now working fine.