I have a SC API that returns an array of IDs, is there an easy way to use data binding client-side to count the number of items of a value (matching the id of a repeat item)
Something like:
{{arrayofIDs.where(someID).count}}
I have a SC API that returns an array of IDs, is there an easy way to use data binding client-side to count the number of items of a value (matching the id of a repeat item)
Something like:
{{arrayofIDs.where(someID).count}}
Yes, you can easily do this using the where
formatter and the count
formatter:
Resulting code is something like:
{{serverconnect1.data.query1.where(`city`, 'Berlin', '==').count()}}