Forms
Resolve linked form tables
/a/Forms_getTablesByIds
Resolve each selected form’s directly linked table definitions and the linking field’s stable ID.
When to use this endpoint
Use this after selecting parent forms when exporting their questions or configuring rules that need a linked Job Table.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session and is scoped to the authenticated tenant.
The handler performs no form, department, owner, or page-permission check unless the page below says otherwise. CRM navigation may impose additional UI-only access rules.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | JSON array string | Yes | Non-empty array of JSON integers. Numeric strings, floats, native arrays, and malformed JSON are rejected. |
Example request
$tables = FM_api('Forms_getTablesByIds', [
'ids' => json_encode([1042]),
]);
Example response
[{"form_id":"1042","tables":[{"id":"2088","name":"Parts used","fields":"[{...}]","meta_id":"1586980384133"}]}]
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: ids"} | IDs are absent. |
{"error":"ids must be an array of integers in JSON form"} | Input is malformed or empty. |
{"error":"not an integer: 3.14"} | An element is not an actual JSON integer. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Only direct fields with exact type
subformand a positiveextras.valuesform ID are followed. - Each table lookup returns raw
id,name, and encodedfields;meta_idcomes from the linking parent field’s decoded metadata. - Missing parent IDs are omitted. Missing linked table IDs are skipped. Neither parent nor linked tables are filtered by archive state.
- The implementation performs one additional query per linked field and specifies no result ordering.
See it in Fieldmotion
CRM1
Forms, Quotes, form-rule editing, and question export use this route.
CRM2
The same workflows use it in the Forms page, Quote module, and Form editor.
Related endpoints
Forms_getFieldNamesByIdsreturns compact question triples.Forms_listTableslists all active Job Tables rather than following parent links.