Guru Query Language
Guru's query language allows for complex queries to be constructed to filter card queries in a manner similar WHERE clauses found in SQL. There are two types of expression; simple expressions and grouping expressions.
Simple expressions operate on a single field and usually contain some sort of operator and a value. For example
lastModified > 2016-01-01T00:00:00.000-00:00.
Grouping expressions support
OR operations to link two or more simple expressions together into a complex expression. For example,
(lastModified < 7_days_ago AND lastModifiedBy = "email@example.com" ) would show all cards that have been modified in the last seven days by the specified user. Parenthesis can be used to ensure proper operation groupings.
Absolute Date Expressions
Used to compare a date field to an absolute date value.
<= Value: A date value in one of the following ISO-8601 formats. NOTE - timezone is required for all formats
dateCreated >= 2016-01-01T00:00+00:00- the card was created after January 1st, 2016 at midnight UTC
lastViewedEvent < 2016-10-15T+00:00- the card was last viewed before October 15th
Relative Date Expressions
Used to compare a date field to a relative time range. For example, finding all cards that have been modified in the last three days.
<= Value: A relative date expression of the form
X is a positive integer. At this time,
days is the only unit available for the relative date expression.
lastModified < 7_days_ago- cards that were modified in the last week
lastVewedEvent > 30_days_ago- cards that haven't been viewed in the last 30 days
Card Type Expression
Used to specify whether to return cards or questions.
type = CARD- only show cards, not questions
Used to compare the card's verification interval to a number of days
<= Value: Number of days, positive integers only
verInterval = 7- cards that must be verified every 7 days
Used to compare numeric fields of a card
boardCount (number of boards a card is on),
favoriteCount (number of times a card has been favorited),
<= Value: A positive integer
viewedCount > 5- cards that have been viewed more than 5 times
boardCount = 0- cards that aren't on a board
File Attachment Expressions
Used to filter for cards that have or do not have file attachments
hasFileAttachment- returns cards that have a file attachment
File Attachment Type
!= Values: Any media type, like
fileAttachmentType = "application/pdf"- cards with PDF attachments
Tag Category Expressions
Used to filter cards that have or don't have Tags from a specific Tag Category.
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx is the ID of the Tag Category. Use the Tag List call to find all Tag Category IDs Operators:
Used to filter cards that have or don't have a specific tag.
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx is the ID of the Tag. Use the Tag List call to find all Tag IDs. Operators:
Used to filter cards associated with a specific user.
creatorId (user that created the card),
verifierId (user that is responsible for verifying the card),
lastVerifiedBy (user that last verified the card),
lastModifiedBy (user that last modified the card) Operators:
!= Values: The email address of the user
creatorId = "firstname.lastname@example.org"cards created by Gary
Used to filter cards associated with a specific group
verifierId (group that is responsible for verifying the card) Operators:
!= Values: The ID of the group
verifierId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx"the group with ID
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxis responsible for verifying this card
Used to filter cards by verification state
verificationState != trustedcards that are not trusted
Share Type Expressions
Used to filter cards based on their visibility
shareType = PRIVATE- show all cards that are private.
Used to filter cards based on a Board that the card is on
CONTAINS Value: the board ID
boards CONTAINS ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")- cards that are on the board with ID