Compound Find Requests and Omit Logic

Beginner

Build multi-request finds that combine AND, OR, and omit logic to retrieve exactly the records you need via the Data API.

What you'll learn

  • How multiple request objects create OR logic
  • How the omit flag subtracts records from the found set
  • How to combine omit with positive requests for complex exclusion queries
  • How to verify find results using foundCount in the response

A single find request ANDs all its field criteria together. To perform an OR across different conditions, you send multiple request objects in the requests array. The omit flag on a request subtracts its matches from the found set. Mastering these three primitives lets you express nearly any query without scripting.

1/4
1

Single vs. multiple find requests

A single request object with multiple fields ANDs those criteria. Place multiple request objects in the array to OR them: the server unions the matching records from each request.

JSON
// AND: Status = "Active" AND Region = "West"
POST /fmi/data/v1/databases/CRM/layouts/Contacts/_find
{
  "query": [
    { "Status": "Active", "Region": "West" }
  ]
}

// OR: (Status = "Active") OR (Status = "Prospect")
{
  "query": [
    { "Status": "Active" },
    { "Status": "Prospect" }
  ]
}

Sign in to track your progress and pick up where you left off.

Sign in to FM Dojo