- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 10:47 PM
Hi I based my work on this previous post- Solved: Calculate sum of flow variable within a for each l... - ServiceNow Community
I have an issue with the Total Sum using only one of the items in the loop. See screenshots
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 10:23 PM
you are correct I checked again and move th code inside the loop and tested working now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 11:22 PM
// Get the current total
var currentTotal = flow.variables.totalDuration || 0;
// Add the current item's duration
var itemDuration = current.duration; // Replace with correct field reference
flow.variables.totalDuration = currentTotal + itemDuration;
✔️ If this solves your issue, please mark it as Correct.
✔️ If you found it helpful, please mark it as Helpful.
—
Shubham Jain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 12:21 AM
then you didn't configure it well
what debugging did you do?
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
07-07-2025 10:23 PM
you are correct I checked again and move th code inside the loop and tested working now.