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.

Field value not capture on form save in ServiceNow Portal(OOB Form Widget)

AlwinJebakY
Tera Expert

In ServiceNow, I used the OOB Form Widget in the portal to display a form and view for specific table. 

Now the user is able to edit the fields, but when the user clicks Save, some field's value is not getting captured. 

That field's value is being set correctly through an OnChange client script and it displays properly on the form.

However, when the Save button is clicked, that field becomes empty. 

I checked no OnSubmit Client script is there and in a Before BR the field values are indeed empty. 

There are no ACLs restricting access
In Native UI it will be working perfectly, problem is in Portal only.

Could there be any other possible issue? 

10 REPLIES 10

@AlwinJebakY 

so form has user field, based on change of that some other fields on same form should be auto populated?

auto population is working fine but the other set of fields are not getting stored.

share some screenshots etc

if you disable client script and populate those fields manually then are those getting saved?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

That field is read only field.
We will set the field value via Script only. 

After set value i put log to get the value from that field. 
That time it will show the data which is set from client script. 

After click save button it will not show that data in that field. 

please share screenshots and your script

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

g_form.setValue("u_shipment_method", Info.Details.shipment_method_ID || "");
g_form.setValue("u_entitlement", Details.entitlementID || "");

 

 console.log('Dispatch Product: '+g_form.getValue('u_entitlement'));

that log is show the data

@Ankur Bawiskar @AlwinJebakY 
We are facing the same issue - on selection of a value in a glidelist field, we are populating 2 other 'choice' fields on the form. When saved/updated on native - the values are getting saved in the database. But - the same is not happening when done via portal.