Power BI
Export Power BI asset data
/a/PowerBI_getAssetData
Export core assets, per-type custom values, and Asset Table values for Power BI.
When to use this endpoint
Use PowerBI_getAssetData for the three legacy asset datasets. Connector callers should request one dataset through PowerBI_getData to reduce work and response size.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session so that the tenant database and user context are available. The handler performs no page or role-permission check.
This direct dataset route does not consume the unsigned api_id/api_key pair used by the Power BI connector. Use PowerBI_getData for the self-authenticating connector feed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from | String | No | An exact lower-bound fragment such as >="2026-09-01". It is not a plain date. |
to | String | No | An exact upper-bound fragment such as <="2026-09-30 23:59:59". It is not a plain date. |
aids | Native array of IDs | No | Select specific assets. A nonempty value takes precedence over the date range. Values are directly joined into the SQL list, so supply numeric IDs only. |
dataset | String | No | asset_data, asset_custom_data, or asset_table_data. Blank returns all three; an unsupported direct value silently falls back to all three. |
Example request
FM_api('PowerBI_getAssetData', [
'from' => '>="2026-09-01"',
'to' => '<="2026-09-30 23:59:59"',
'dataset' => 'asset_data',
]);
Example response
{
"asset_data": [{"asset_id":"481","asset_name":"Pump 7","asset_type_name":"Pump","asset_type_id":"3","book_id":"P-7","code":"P007","date_created":"2026-09-03 08:00:00","is_archived":"No","last_edited":"1727441000","location_type":"Customer","location_id":"1042","location_name":"Example Ltd","make":"Acme","asset_meta":"{}","type_meta":"{}","model":"PX","owner_id":"1042","owner_name":"Example Ltd","qr":"","value":"1200.00","warranty":"2027-09-03"}],
"asset_custom_data": [],
"asset_table_data": []
}
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":"invalid parameter: from"} | A nonempty from has the wrong shape. |
{"error":"invalid parameter: to"} | A nonempty to has the wrong shape. |
Database error or malformed response | aids is not a native numeric array or contains unsafe/non-numeric list content. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Soft-deleted assets are excluded. With no IDs, both date bounds filter asset creation time; a partial date range is ignored. With neither filter, all active asset rows are exported in asset-name descending order.
is_archivedbecomesYes/No. Location types normally becomeLocation,Customer, orAssetand names are resolved against active destinations. A legacy falsey check means type ID0currently exports a blank type/name even when a location ID exists.asset_custom_datais keyed by asset type. A type-specific CRM2 layout wins; otherwise a legacy type template is used, then the shared CRM2 layout. Saved values use layout IDs but exported columns use layout labels.- Fields shared across types or explicitly marked shared are also emitted in synthetic type
-1named_Shared. Every shared row has the complete lowercased shared-column schema, with missing values as empty strings. asset_table_datais keyed by table ID withtable_nameanddata. It reads 100 rows then batches of 1,000, maps configured field labels, and renders numeric epoch-like datetime values asY-m-d H:i:s. Missing table configuration yields an empty dataset.- There is no client-controlled pagination. A projected
asset_table_datacall skips the main asset query; other projections skip unrequested result construction where supported.
See it in Fieldmotion
CRM1
The legacy connector builds Assets, Asset Custom Values, and Asset Table Values navigation entries from these three keys.
CRM2
CRM2 Asset Type layouts define custom export columns when present; CRM2 does not use this endpoint for its asset screens.
Related endpoints
PowerBI_getAssetLocationHistoryDataexports movement rows.PowerBI_getDatais the supported aggregate connector feed and supplies tenant settings to this helper.PowerBI_authenticateestablishes the unsigned connector session used by the aggregate feed.