When to use this endpoint

Use AssetTables_getDataTable for CRM2’s Asset Table widget. Request the stored data field so the handler can expand configured JSON keys into dynamic column<id> response properties.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.

The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.

Parameters

ParameterTypeRequiredDescription
fieldsArrayYesNative array containing any of id, tableID, assetID, data, cDate, and lastEdited. Unknown names are ignored and id is always added. Include data to receive dynamic columns.
tableID / assetIDInteger string or arrayNoExact mapped filters. CRM2 supplies both to scope the embedded table. Arrays become numeric IN filters.
isTableInteger stringNoDefaults to table mode. Exact integer 0 returns only data and permits an optional positive limit.
draw / start / lengthInteger stringsNoTable counter, zero-based offset, and page size; defaults are 0, 0, and 10. Zero and negative lengths are not rejected before SQL.
limitInteger stringNoMaximum rows only in non-table mode. Zero means unlimited.
orderBy / orderDescField name / directionNoNamed ordering pair for mapped fields. Invalid names fall back case-insensitively and then to a requested mapped field.
order[0][column] / order[0][dir]DataTables valuesNoFallback table ordering. The shared engine subtracts one from the UI column index and accepts exact desc as descending.
searchValue / searchFieldString / string or arrayNoCase-insensitive substring search over selected mapped fields; omitted searchField searches every mapped field. Dynamic column<id> properties are not part of this search map.
referenceDate / dateFrom / dateToString / integer offsetsNoFor a configured table field, send referenceDate=column<field-id> plus both relative day offsets. The JSON value is cast to datetime and compared inclusively against server-calendar day boundaries.
Other mapped filters / advanceSearch / groupByMixed shared table valuesNoThe generic CRM2 engine also accepts mapped scalar/array filters, advanced conditions, and mapped grouping. Dynamic columns are not mapped for these generic features.

Example request

$table = FM_api('AssetTables_getDataTable', [
	'fields' => ['id', 'tableID', 'assetID', 'data', 'cDate', 'lastEdited'],
	'tableID' => '1700000000123',
	'assetID' => '418',
	'draw' => '2',
	'start' => '0',
	'length' => '25',
	'orderBy' => 'cDate',
	'orderDesc' => 'desc',
]);

Example response

{
  "data": [
    {
      "id": "92",
      "tableID": "1700000000123",
      "assetID": "418",
      "data": "{\"1\":\"8.2\",\"2\":\"passed\"}",
      "cDate": "2026-09-24 10:15:00",
      "lastEdited": "2026-09-24 10:15:00",
      "column1": "8.2",
      "column2": "passed"
    }
  ],
  "draw": 2,
  "recordsTotal": "14",
  "recordsFiltered": "1"
}

Errors and unusual responses

ResponseCondition
{"error":"not logged in"}No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs.
{"error":"missing or invalid parameter: fields"}fields is absent.
{"error":"error in database query"}The generated mapped/filter query fails.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • Table mode returns page rows plus draw and database scalar counts. recordsTotal counts every Asset Table row in the tenant; recordsFiltered applies all supplied filters.
  • After the query, truthy decoded data objects are expanded into column<key> properties. The original encoded data field remains. If data was not requested, no dynamic fields can be added.
  • No asset-existence or soft-delete filter is applied. There is no default table/asset scope, so callers should supply both.

See it in Fieldmotion

CRM1

No production CRM1 caller was found; CRM1 uses AssetTable_getData and paginates in the browser.

CRM2

Open an asset’s configured table, then search, sort, page, or change a date-field filter while inspecting AssetTables_getDataTable. The shared widget supplies tableID and assetID.

Related endpoints