Asset tables
Query mapped Asset Table rows
/a/AssetTables_getDataTable
Query Asset Table rows through CRM2’s paged named-field table engine.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
fields | Array | Yes | Native 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 / assetID | Integer string or array | No | Exact mapped filters. CRM2 supplies both to scope the embedded table. Arrays become numeric IN filters. |
isTable | Integer string | No | Defaults to table mode. Exact integer 0 returns only data and permits an optional positive limit. |
draw / start / length | Integer strings | No | Table counter, zero-based offset, and page size; defaults are 0, 0, and 10. Zero and negative lengths are not rejected before SQL. |
limit | Integer string | No | Maximum rows only in non-table mode. Zero means unlimited. |
orderBy / orderDesc | Field name / direction | No | Named 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 values | No | Fallback table ordering. The shared engine subtracts one from the UI column index and accepts exact desc as descending. |
searchValue / searchField | String / string or array | No | Case-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 / dateTo | String / integer offsets | No | For 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 / groupBy | Mixed shared table values | No | The 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
| Response | Condition |
|---|---|
{"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
drawand database scalar counts.recordsTotalcounts every Asset Table row in the tenant;recordsFilteredapplies all supplied filters. - After the query, truthy decoded
dataobjects are expanded intocolumn<key>properties. The original encodeddatafield remains. Ifdatawas 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
AssetTable_getDatais the unpaged legacy reader.AssetTable_exportstreams the same asset/table scope as CSV.