Autorun AI Docs

3. Get Record


context.sdk.entities.getById({ params })

async · returns the record

Retrieves a single record by its ID.

Prop

Type

const result = await context.sdk.entities.getById({
  params: { entitySlug: "lectures", recordId: context.router.id }
});
const lecture = result?.data ?? result;
console.log("Lecture", lecture);
Envelope vs record

Some responses put the row on .data; others return the row directly. Reading result?.data ?? result covers both. If a field you expect is undefined, you are almost certainly on the envelope rather than the row.

Lookup fields arrive expanded:

{
  "ID": 12,
  "Title": "Introduction to React",
  "Instructor": { "ID": 3, "Name": "Jane Doe" },
  "Date": "2026-03-15T10:00:00Z",
  "SystemStatusID": { "ID": 1, "Name": "Active" }
}

context.sdk.entities.getBySlug({ params, query? })

async · returns { data, totalCount, rowCount, ... }

Retrieves multiple records. Filter, sort, and page through query.

Prop

Type

const response = await context.sdk.entities.getBySlug({
  params: { entitySlug: "invoices" }
});
const invoices = response.data || [];
const userId = context.user?.id;
const response = await context.sdk.entities.getBySlug({
  params: { entitySlug: "timeoff" },
  query: {
    filter: [
      "filter=and_Employee_eq_" + userId,
      "filter=and_Status_eq_2"
    ]
  }
});
const timeOffs = response.data || [];
const response = await context.sdk.entities.getBySlug({
  params: { entitySlug: "timeoff" },
  query: {
    skip: 0,
    take: 100,
    sort: "CreateDate_descending",
    filter: ["filter=and_Employee_eq_" + context.user?.id]
  }
});

Returned value

{
  "data": [
    {
      "ID": 101,
      "InvoiceNumber": "INV-2026-001",
      "Company": { "ID": 5, "Name": "Acme Corp" },
      "TotalAmount": 1500.00
    }
  ],
  "totalCount": 42,
  "rowCount": 1
}
Filter syntax

Each filter string follows filter=and_{FieldName}_{operator}_{value}. Common operators: eq, neq, gt, lt, gte, lte, contains. Chain conditions by passing multiple strings in the filter array. For a lookup, filter on the foreign key (the field name), not the expanded display object.