Count The Number of Items in List after Filter

I have a list control onto which I apply a dynamic filter based upon the profile of the user accessing the form. I would like to provide a count of items in the list based upon this filter. Currently using:
fd.control('MyList').widget.dataItems().length;
This returns the total number of items in the list. Is it possible to count after filtering?

Thanks,
Chad

Dear @cwalter2,
It's best to use pnpjs with custom filter to retrieve these items and get their number - List Items - PnP/PnPjs

Here you can find an example of how it can be used to get all items - Unable to get List Items with CAML Query - #2 by mnikitina

1 Like