I have a query and want to count records with a certain value. The Set Value is immediately following the query.
If I just count without a where clause it works fine and returns a value of 5
{{rebates.count()}}
If I count using where I get an error “formatter expects and array”
{{rebates.count().where(rebates[0].RebateProgramID, “==”, 8)}}
In the debug code it looks like this
{{rebates.count().where(rebates[0].RebateProgramID, “==”, 8)}}
Thanks Brad, changed it and same error.
{{rebates.count().where(rebates.RebateProgramID, “==”,8)}}
On debug
{{rebates.count().where(rebates.RebateProgramID, “==”,8)}}
Also, I changed it back to the original and did use the value of the first record returned and got the same error
{{rebates.count().where(rebates[0].RebateProgramID, “==”, 8)}}
It might help if I explained what I need it to do. The query returns multiple records. I want to set a value of the count for a specific number. Don’t need an array. Should be simple but Im evidently missing something.
Run query
Returns multiple records
Set a value the contains the count of all records where ProductRebateID = 8
ValueName =15
If I run count on the query i get the correct number of records, so assumed I would then add a where to the count. Do I need to run a repeat on the query then do it?