You are able to filter your get requests (Folios, Entities, Contacts) by built in fields and custom fields.
Built in Fields
You are able to filter for the built in fields by using their name in the query, below are all of the ones listed for Folios, Entities and Contacts.
To Filter for the key, Includes partial matches so you can just do FOL to see all the folios with key starting with FOL
{ folios(key:"FOL-18") { nodes { key title } } }
|
To filter for user based fields, createdBy, updatedBy, closedBy, publishedBy, personResponsible
{ folios(personResponsible:{ids:["MDBVc2VyLTM5"]}) { nodes { key createdAt title } } }
|
To filter for date based fields: createdAt, closedAt, updatedAt, publishedAt, commencementDate, endDate, variationEndDate, openDuring
{ folios(createdAt:{min:"2020-11-17", max:"2020-11-19"}) { nodes { key title } } }
|
Folio specific Filters
To Filter for the Title, you can also do partial matches
{ folios(title:"2021") { nodes { key title } } }
|
To filter for variation status you just need to select one of the following status
- approved
- in_progress
- rejected
- abandoned
{ folios(variationStatus:in_progress) { nodes { key title } } }
|
To filter for approval status you just need to select one of the following status
- requested
- rejected
- approved
- sent_back
- no_request
{ folios(approvalStatus:approved) { nodes { key title } } }
|
To filter for the publicLinkEmail, you can also do partial matches
{ folios(publicLinkEmail: "@example.com") { nodes { key Title publicLinkEmail } } }
|
To filter for user Templates you use the template id
{ folios(template:["MDBDb250cmFjdFRlbXBsYXRlLTI3"]) { nodes { key title } } }
|
To filter for the Stage you use the Stageid as an array
{ folios( folios(stage:["MDBTdGFnZS05Ng"]) { nodes { key title } } }
|
To filter for status you can do either open or closed
{ folios(status:closed) { nodes { key title } } } { folios(status:open) { nodes { key title } } }
|
To filter for the Business Units you use the business unit id as an array
{ folios( businessUnits: {ids: ["MDBCdXNpbmVzc1VuaXQtNQ", "MDBCdXNpbmVzc1VuaXQtMQ"]} ) { nodes { key createdAt title businessUnits { nodes { id title } } } }
|
Custom Fields
You are able to filter for custom fields by using their libararyFieldID, An example query is shown below - Where i am filtering for answers in a short text field that contain the text "Serious"
{ folios(customFields:[{fieldId: "MDBGaWVsZC0zNg", textFilter: {texts: ["Serious"]}}]) { nodes { customFieldResponses(libraryFieldIds: ["MDBGaWVsZC0zNg", "MDBGaWVsZC0zNQ"]) { ... on TextFieldResponse { text } } } } }
|
There are different rules for each field type, they are explained below
Text Fields
You can filter for both short and long test fields by using texts. Texts expects an array of strings to search for.
{ folios(customFields:[{fieldId: "MDBGaWVsZC0zNg", textFilter: {texts: ["Serious", "Moderate"]}}]) { nodes { customFieldResponses(libraryFieldIds: ["MDBGaWVsZC0zNg", "MDBGaWVsZC0zNQ"]) { ... on TextFieldResponse { text } } } } }
|
Numeric Fields
You can filter any numeric fields like below, you can filter for a range (ie between 100-1000) or if you want to filter for one number you can put the same number in from and to
{ folios(customFields:[{fieldId: "MDBGaWVsZC0zNg", textFilter: {numericFilter:{from:10,to:12}}]) { nodes { customFieldResponses(libraryFieldIds: ["MDBGaWVsZC0zNg", "MDBGaWVsZC0zNQ"]) { ... on NumericFieldResponse { numeric } } } } }
|
Date Fields
You can filter date fields like below, with both a range (ie between 2022-03-16-2022-03-17) or an exact date use the same date on from and to
{ folios(customFields:[{fieldId: "MDBGaWVsZC0zNg", dateFilter: {from: "2022-03-16", to: "2022-03-17"}}]) { nodes { customFieldResponses(libraryFieldIds: ["MDBGaWVsZC0zNg", "MDBGaWVsZC0zNQ"]) { ... on DateFieldResponse { date } } } } }
|
Time Fields
You can filter date fields like below, the object has both hour and minute values, with both a range or an exact date use the same time object on from and to
{ folios(customFields:[{fieldId: "MDBGaWVsZC0yMzQ", timeFilter: {from:{hour:15, minute:58}, to:{hour:15, minute:58}}}]) { nodes { customFieldResponses(libraryFieldIds: ["MDBGaWVsZC0zNg", "MDBGaWVsZC0zNQ"]) { ... on TimeFieldResponse { time hour minute } } } } }
|
Address Fields
You can filter for addresses as below, the addressFilter object has each address part in it, you can also only include the ones you want to - you dont have to have them all.
{ folios(customFields:[{fieldId:"MDBGaWVsZC05MjE4", addressFilter:{line1:"Suite 203", line2:"15 Belvoir St", suburb:"Surry Hills", state:"NSW", postcode:"2010", country:"AU"}}]) { nodes { customFieldResponses(libraryFieldIds: ["MDBGaWVsZC0zNg", "MDBGaWVsZC0zNQ"]) { ... on AddressFieldResponse { line1 line2 suburb state postcode country } } } } }
|
Signature Fields
You can filter for signed signature fields, the signatureFilter object has a boolean called sign, that is True if there is a signature, or False if there is none
{ folios(customFields:[ {fieldId: "MDBGaWVsZC05NzIw", signatureFilter: {signed:true}}]) { nodes { customFieldResponses(libraryFieldIds: ["MDBGaWVsZC0zNg", "MDBGaWVsZC0zNQ"]) { ... on SignatureFieldResponse { isSigned } } } } }
|
Select Fields
You can filter for Single and Multi selects using SelectFilter, There are multiple options for this but the general one is to use FieldAnswerIds as shown below, and have an array of id’s for the answers you want.
{ folios(customFields:[{fieldId:"MDBGaWVsZC0yMjg4", selectFilter:{fieldAnswerIds:["MDBGaWVsZEFuc3dlci0yMzg1"]}}]) { nodes { customFieldResponses(libraryFieldIds: ["MDBGaWVsZC0zNg", "MDBGaWVsZC0zNQ"]) { ... on SelectFieldResponse { answers { nodes { fieldAnswer{text}, freeformText } } } } } } }
|
If you are filtering on an Hierarchy field for Lookup Field you can also include the sub-answers
{ folios(customFields:[{fieldId:"MDBGaWVsZC0yMjg4", selectFilter:{includeBranch:true,fieldAnswerIds:["MDBGaWVsZEFuc3dlci0yMzg1"]}}]) { nodes { customFieldResponses(libraryFieldIds: ["MDBGaWVsZC0zNg", "MDBGaWVsZC0zNQ"]) { ... on SelectFieldResponse { answers { nodes { fieldAnswer{text}, freeformText } } } } } } }
|
If you want to filter for all empty values you can use matchNone:true, or if you want to find all results that have an answer you can filter for matchNone:False
{ folios(customFields:[{fieldId:"MDBGaWVsZC0yMjg4", selectFilter:{matchNone:true}}]) { nodes { customFieldResponses(libraryFieldIds: ["MDBGaWVsZC0zNg", "MDBGaWVsZC0zNQ"]) { ... on SelectFieldResponse { answers { nodes { fieldAnswer{text}, freeformText } } } } } } }
|
If you are filtering for a custom lookup field you will be using the specific key in the selectFilter for that lookup type - along with the id for the item you are looking up (for example the Business Unit ID if you are filtering on a custom Business Unit Lookup Field). Below is an example for filtering for a business unit.
{ folios(customFields:[{fieldId:"MDBGaWVsZC0yMjg4", selectFilter:{businessUnitIds:["MDBGaWVsZEFuc3dlci0yMzg1"]}}]) { nodes { customFieldResponses(libraryFieldIds: ["MDBGaWVsZC0zNg", "MDBGaWVsZC0zNQ"]) { ... on SelectFieldResponse { answers { nodes { fieldAnswer{text}, freeformText } } } } } } }
|
The other keys selectFilter takes are:
- businessUnitIds
- userIds
- programIds
- locationIds
- entityIds
- contactIds
- folioIds