Embedded list in servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
18 hours ago
On the native UI form, we have added an embedded list. We want the system to calculate the total claim amount only when the user enters data into the embedded list, and update the Total Claim Amount field accordingly.
It will make calculate the total of claim field which is in the embedded list and total will store into the total claim amount field.
i.e. currently we have two records in the embedded list so the total of claim amount is 958 so it will 958 in the total claim field
This calculation should happen before the form is submitted, without saving the claim record.
Currently, we are able to achieve this calculation on form submission, but our requirement is to perform the calculation before the form is submitted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
18 hours ago
you can run after insert BR on your embedded list table and then sum up all the values for the parent and update the parent record.
With this if you see the updated value on form then good.
if this doesn't work then your user need to reload the form.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
18 hours ago
Hi @Praju_123 ,
You can achieve this using the onCellEdit functionality on the embedded list.
Since your requirement is to calculate the total claim amount before the record is submitted (while the user is editing the embedded list), a Business Rule won’t work because that only runs after save. Instead, you can configure an onCellEdit Client Script on the child table (the one shown in the embedded list).
How it works:
The onCellEdit script runs as soon as a user edits a cell in an editable list.
You can capture changes to the Claim Amount field, sum up all claim line values, and then use g_form.setValue() to update the Total Claim Amount field on the parent form dynamically.
This way, the parent field is updated in real time without saving the form.
In short: Yes, it’s possible, configure an onCellEdit script on the child table, calculate the total of the claim amount field, and set that total into the parent form’s Total Claim Amount field.
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.