Support 2 new optional config parameters for Contacts, Events and SentEmails
Closed this issue · 2 comments
In order to get the API to do some filtering for us before GDS gets the data let's support the $filter
and $count
arguments to the API call. These are optional.
For Contacts
and Events
both $filter and $count can be added as config parameters:
Filter
text box
Return count only
checkbox
For Contacts
object the Filter
config parameter should have the following description text displayed:
Create a filter clause to return only a subset of contact records to speed up processing in Google Data Studio. See https://gethelp.wildapricot.com/en/articles/502#filtering for more details.
For Events
object the Filter
config parameter should have the following description text displayed:
Create a filter clause to return only a subset of event records to speed up processing in Google Data Studio. See https://gethelp.wildapricot.com/en/articles/499-events-admin-api-call#filtering for more details.
For SentEmails
object only the Filter
config parameter should be available.
The following description text for the Filter
text box parameter should be displayed
`Allowed filter fields (allowed operations):
SentDate (ge, le),
SenderId (eq) - ID of sender,
OriginType (eq) - see SentEmail.Origin.OriginType,
SendingType (eq) -SentEmail.SendingType (Automatic or Manual)
The AND boolean operator supported only for this filter.
...&$filter=SentDate ge 2018-05-01 - will return records sent on or after May 1st, 2018`
Concerns
- One concern I have with this is if the user enters an invalid
$filter
, the api just returns an error, which could cause frustration. - I think the addition of the count field might cause confusion as the field will always be visible in the explorer even when not in use.
Implementation Notes
- The
$filter
param is already being used for the archived and member checkboxes for contacts. If the user includes these in the filter field as well, the user supplied$filter
is appended with anAND
clause. - For the addition of the
$count
param, I added a count field to the schema, then filled a single row with the returned count, leaving every other field blank. - Description fields do not support multi-line text, so the
SentEmails
filter description looks a little strange for now.
Looks good @stephenpoole -- makes the performance doing counts and filters much faster.