- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi All,
I'm working in a requirement to capture the count of values in watchlist field using flow designer.
I tried using input type as array.string and array.object but its not working.
Any help is really appreciated.
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @ranjanak ,
Can you try flow variable (Integer type) and get the watchlist count as below
1.Declare flow variable integer type Integer
2. Use set flow variable step
3. Output
Hope this helps!
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @ranjanak ,
Can you try flow variable (Integer type) and get the watchlist count as below
1.Declare flow variable integer type Integer
2. Use set flow variable step
3. Output
Hope this helps!
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Hemanth M1 ,
Thanks for your help, I followed your steps and it is working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @ranjanak ,
The watchlist stores a comma separated list.
Use the existing record (Look up record) and compute the count with inline script when setting a variable.
Add “Set flow variables” (create an Integer variable like watchlistCount) or “Update record” to store the count somewhere.
In the value for watchlistCount, click the Script icon (fx) and try below script:
(function() {
var s = (fd_data.current.watch_list || '').toString().trim();
if (!s) return 0;
// Remove empty entries and whitespace, then count
var arr = s.split(',').map(function(x){return (x||'').trim();}).filter(function(x){return x;});
return arr.length;
})();
Please go through below how to iterate watchlist in flow designer.
Thanks,
Bhimashankar H
-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!