Skip to main content

Filtering Records

Pass a Dictionary<string, string> of filters to SearchAsync to narrow down results. Filter keys follow the pattern EntityName_PropertyName. Multiple filters are combined with AND logic.

Filter by text field

var endpoint = new CoworkerEndpoint(client);

var filters = new Dictionary<string, string>
{
    ["Coworker_FullName"] = "Jane"
};

SearchResult<Coworker> result = await endpoint.SearchAsync(filters);

Filter by email

var filters = new Dictionary<string, string>
{
    ["Coworker_Email"] = "jane@example.com"
};
var result = await endpoint.SearchAsync(filters);

Filter by enum

Pass the integer value of the enum member:
var filters = new Dictionary<string, string>
{
    ["Coworker_CoworkerType"] = "1" // Individual
};
var result = await endpoint.SearchAsync(filters);

Filter by foreign key ID

var filters = new Dictionary<string, string>
{
    ["Booking_Resource"] = "98765"
};
var result = await new BookingEndpoint(client).SearchAsync(filters);
Use dot-separated paths to filter on properties of related entities:
var filters = new Dictionary<string, string>
{
    ["Booking_Resource_Name"] = "Meeting Room A"
};
var result = await new BookingEndpoint(client).SearchAsync(filters);

Combine multiple filters

All filters are ANDed together. You can also combine filtering with pagination:
var filters = new Dictionary<string, string>
{
    ["Coworker_CoworkerType"] = "1",
    ["Coworker_CompanyName"] = "Acme"
};

var result = await endpoint.SearchAsync(filters, page: 2, size: 5);

Sorting results

In addition to filtering, you can control the sort order by passing orderBy and dir to SearchAsync:
var filters = new Dictionary<string, string>
{
    ["Coworker_CompanyName"] = "Acme"
};

// Filter by company AND sort by FullName descending
var result = await endpoint.SearchAsync(filters, page: 1, size: 25, orderBy: "FullName", dir: 1);
ParameterTypeValues
orderBystringAny property name on the entity.
dirint0 = ascending (default), 1 = descending.
If orderBy is not specified, the API uses the entity’s default sort property.

Filter key reference

PatternExampleDescription
Entity_PropertyCoworker_FullNameDirect property on the entity.
Entity_Property (enum)Coworker_CoworkerTypeEnum field — pass the integer value.
Entity_ForeignKeyBooking_ResourceForeign key — pass the related ID.
Entity_ForeignKey_PropertyBooking_Resource_NameProperty on a related entity.