Activities can be filtered by all their fields, and they support powerful combinations that allow you to
- get new activities with very bad sentiment, or
- get activities of high score in specific channels that mention Python,
amongst many other excellent use cases.
This page will guide you through everything you need to know to construct creative filters to get great insights from your community.
Fields and types for filtering and sorting
The following table shows all the possible fields for which activities can be filtered and sorted. The filter type defines which type-specific operators can be used. All fields can be used with general operators and composition.
Sortable fields can always be sent as {fieldName}_{ASC | DESC}
Field | Filter type | Example | Sortable |
---|---|---|---|
type | String | {"type": "message"} | ✔️ |
platform | String | {"platform": "discord"} | ✔️ |
timestamp | Date | {"timestamp": {"gte": "2022-01-01"}} | ✔️ |
title | String | {"title": {"textContains": "issue title"}} | ✔️ |
body | String | {"body": {"textContains": "issue body"}} | ✔️ |
channel | String | {"channel": {"textContains": "dev"}} | ✔️ |
url | String | {"url": {"textContains": "https://github.com/"}} | ✔️ |
sentiment | Number | {"sentiment": {"lt": 50}} | ✔️ |
sentiment.[positive,negative,mixed,neutral] | Number | {"sentiment.mixed": {"gt": 70}} | ✔️ |
score | Number | {"score": {"gt": 5}} | ✔️ |
memberId | String | {"memberId": "918f26a1-5a8b-43d6-bbee-e7e1c5f805a6"} | ✘ |
conversationId | String | {"memberId": "5a6bf0dd-4d06-4bd4-b37e-b0cba761d6b2"} | ✘ |
parentId | String | {"memberId": "9cf6b6b1-2d25-4695-a91e-f79586af853a"} | ✘ |
sourceId | String | {"sourceId": "12345"} | ✔️ |
sourceParentId | String | {"sourceParentId": "12345"} | ✔️ |
isKeyAction | Bool | {"isKeyAction": true} | ✘ |
tasks | Many-to-Many | {"tasks: ["94924f9e-b23e-463f-984e-f75a34f021aa"]} | ✘ |
createdAt | Date | {"createdAt": {"gte": "2022-01-01"}} | ✔️ |
Examples
Negative activities that either are part of a conversation or happened on Twitter
sentiment
is lower than 50, and- either
conversationId
is notnull
, orplatform
is Twitter
Sorted by average sentiment.
{
"filter": {
"sentiment": {
"lt": 50
},
"or": [
{
"platform": "twitter"
},
{
"not": {
"conversationId": "NULL"
}
}
]
},
"orderBy": "sentiment_ASC",
"limit": 20,
"offset": 0
}
Activities of high score in specific channels that mention Python
channel
is either support or bugs, but not dev, andscore
is at least 5, and- either
- title contains Python, or
- body contains Python
{
"filter": {
"channel": {
"in": [
"support",
"bugs"
],
"not": "dev
},
"score": {
"gte": 5
},
"or": [
{
"title": {
"textContains": "python"
}
},
{
"body": {
"textContains": "python"
}
}
]
},
"orderBy": "timestamp_ASC",
"limit": 20,
"offset": 0
}
New activities with terrible sentiment
- timestamp is within a week, and
- the sentiment is lower than 25
{
"filter": {
"timestamp": {
"gte": "2022-01-01"
},
"sentiment": {
"lt": 25
}
},
"orderBy": "timestamp_ASC",
"limit": 20,
"offset": 0
}