# ViewFoundSet Total Size

**URL:** <https://forum.servoy.com/t/viewfoundset-total-size/23896>\
**Category:** Questions\
**Created:** [March 14, 2025, 4:20am UTC](https://forum.servoy.com/t/viewfoundset-total-size/23896 "2025-03-14T04:20:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![seain](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/seain/32/4511_2.png) [@seain](https://forum.servoy.com/u/seain)\
**Post date:** [March 14, 2025, 4:20am UTC](https://forum.servoy.com/t/viewfoundset-total-size/23896/1 "2025-03-14T04:20:45Z")

</div>

What is the best way to get the total size of a [`ViewFoundSet`](https://docs.servoy.com/reference/servoycore/dev-api/database-manager/viewfoundset)?

`databaseManager.getFoundSetCount()` doesn’t support `ViewFoundSet`.  
`ViewFoundSet.getSize()`will only return a maximum of 200.

I devised a generic method as follows. Is there a better way?

```auto
/**
 * @param {ViewFoundSet} _vfs
 * @return {Number}
 * @public 
 */
function getViewFoundSetCount(_vfs) {
	const _query = _vfs.getQuery();
	
	_query.result.clear().add(_query.aggregates.count());
	
	const _ds = databaseManager.getDataSetByQuery(_query, 1);
	
	return _ds.getMaxRowIndex() ? _ds.getRowAsArray(1)[0] : 0;
}

```

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [March 14, 2025, 10:13am UTC](https://forum.servoy.com/t/viewfoundset-total-size/23896/2 "2025-03-14T10:13:39Z")

</div>

Hi Seain,

Servoy currently doesn’t support `databaseManager.getFoundSetCount()` for view foundsets.  
It would be a good addition , please create a feature request on [support.servoy.com](http://support.servoy.com).

You method to get the count does about what happens internally in Servoy, it looks good as a workaround.

Rob
