Autorun AI Docs
Process DesignerBusiness FunctionBusiness Functions Reference

2. Get Record


get(slug)

async · returns EntityCollection

Fetches all records for the specified entity with no filtering, sorting, or pagination applied.

const allClients = await context.functions.get("clients");
log("Total clients: " + allClients.length);

Returned value

An EntityCollection — an array of all non-deleted Entity objects for the slug, each with system fields:

"records": [
  {
    "Attributes": {
      "ID": "1",
      "Name": "Acme Corp",
      "Email": "contact@acme.com",
      "IsActive": true,
      "CreateDate": "2025-01-10T08:00:00Z",
      "CreateUser": {
        "ID": "1",
        "FullName": "Mileva Service"
      },
      "ModifyDate": "2025-06-01T10:00:00Z",
      "ModifyUser": {
        "ID": "3",
        "FullName": "Jane Doe"
      },
      "SystemStatusID": {
        "ID": "1",
        "Name": "Active"
      }
    }
  },
  {
    "Attributes": {
      "ID": "2",
      "Name": "Globex Inc",
      "Email": "info@globex.com",
      "IsActive": true,
      "CreateDate": "2025-02-14T09:30:00Z",
      "CreateUser": {
        "ID": "1",
        "FullName": "Mileva Service"
      },
      "ModifyDate": "2025-02-14T09:30:00Z",
      "ModifyUser": {
        "ID": "1",
        "FullName": "Mileva Service"
      },
      "SystemStatusID": {
        "ID": "1",
        "Name": "Active"
      }
    }
  },
  {
    "Attributes": {
      "ID": "3",
      "Name": "Initech Ltd",
      "Email": "hello@initech.com",
      "IsActive": false,
      "CreateDate": "2025-03-01T11:00:00Z",
      "CreateUser": {
        "ID": "5",
        "FullName": "Bob Admin"
      },
      "ModifyDate": "2026-01-15T08:45:00Z",
      "ModifyUser": {
        "ID": "5",
        "FullName": "Bob Admin"
      },
      "SystemStatusID": {
        "ID": "2",
        "Name": "Inactive"
      }
    }
  }
]

get(slug, options)

async · returns EntityCollection

Fetches records with filtering, sorting, and pagination applied.

The options object must contain at least one of filter, pagination, or sort. Passing an options object with none of those three keys throws an error — use get(slug) for unfiltered full-table reads.

Prop

Type

const results = await context.functions.get("orders", {
  filter: { field: "Status", operator: "Equal", value: "pending" },
  pagination: { skip: 0, take: 2 },
  sort: [{ name: "CreateDate", direction: "descending" }]
});
const servicesBought = await context.functions.get("servicesbought", {
  filter: {
    condition: "AND",
    isComplex: true,
    predicates: [
      { field: "Client", operator: "equal", value: context.user.id },
      { field: "Status", operator: "equal", value: "1" }
    ]
  },
  pagination: { skip: 0, take: 50 }
});

Returned value

An EntityCollection containing only the matching records, in the requested sort order, each with system fields:

"records": [
  {
    "Attributes": {
      "ID": "99",
      "ClientName": "Acme Corp",
      "Amount": 800.00,
      "Status": "pending",
      "CreateDate": "2026-03-12T09:00:00Z",
      "CreateUser": {
        "ID": "7",
        "FullName": "John Smith"
      },
      "ModifyDate": "2026-03-12T09:00:00Z",
      "ModifyUser": {
        "ID": "7",
        "FullName": "John Smith"
      },
      "SystemStatusID": {
        "ID": "1",
        "Name": "Active"
      }
    }
  },
  "Attributes": {
    "ID": "97",
    "ClientName": "Globex Inc",
    "Amount": 1200.00,
    "Status": "pending",
    "CreateDate": "2026-03-11T14:30:00Z",
    "CreateUser": {
      "ID": "3",
      "FullName": "Jane Doe"
    },
    "ModifyDate": "2026-03-11T14:30:00Z",
    "ModifyUser": {
      "ID": "3",
      "FullName": "Jane Doe"
    },
    "SystemStatusID": {
      "ID": "1",
      "Name": "Active"
    }
  }
]

getById(slug, id)

async · returns Entity

Fetches a single record by its numeric ID. Returns null if no record with that ID exists.

Prop

Type

const record = await context.functions.getById("products", 42);

Returned value

The full Entity object with custom and system fields, or null if no record with that ID exists:

"Attributes": {
  "ID": "42",
  "Name": "Gadget Pro",
  "Price": 99.99,
  "Stock": 150,
  "Category": "Electronics",
  "CreateDate": "2025-11-20T08:00:00Z",
  "CreateUser": {
    "ID": "1",
    "FullName": "Mileva Service"
  },
  "ModifyDate": "2026-01-05T14:22:00Z",
  "ModifyUser": {
    "ID": "3",
    "FullName": "Jane Doe"
  },
  "SystemStatusID": {
    "ID": "1",
    "Name": "Active"
  }
}