When to use this endpoint

Open this before formConfigSave. The mapping refers to field metadata IDs, while saved Job answers are looked up by the corresponding field names.

Authentication and permissions

Authenticate with signed API-key fields or a logged-in CRM session; session dispatch applies CSRF checks. The authenticated tenant must have features2.ukDigitalWasteManagement=1. The feature is read from the account record, not trusted from request input.

Requires Forms Edit through Core_requirePermission('edit', 'pageForms'), including this configuration read.

Parameters

ParameterTypeRequiredDescription
form_idInteger-compatibleYesNonzero existing, non-archived local Job Form (type 0). Archived or missing Forms return form not found.

Example request

$result = FM_api('DigitalWasteTracking_formConfigGet', [
	'form_id'=>'410',
]);

Example response

{
  "id": 410,
  "name": "Synthetic receipt",
  "fields": [
    {
      "id": "carrier-name",
      "name": "Carrier",
      "type": "input",
      "form_id": 0
    },
    {
      "id": "transport",
      "name": "Transport",
      "type": "select",
      "form_id": 0
    },
    {
      "id": "site-picker",
      "name": "Receiving site",
      "type": "select",
      "form_id": 0
    },
    {
      "id": "waste-table",
      "name": "Waste items",
      "type": "subform",
      "form_id": 411
    }
  ],
  "tables": [
    {
      "id": "waste-table",
      "name": "Waste items",
      "form_id": 411,
      "fields": [
        {
          "id": "ewc",
          "name": "EWC",
          "type": "input",
          "form_id": 0
        },
        {
          "id": "description",
          "name": "Description",
          "type": "textarea",
          "form_id": 0
        }
      ]
    }
  ],
  "profiles": [
    {
      "id": "aaaaaaaaaaaaaaaa",
      "name": "North receiving site",
      "environment": "test"
    }
  ],
  "default_profile_id": "aaaaaaaaaaaaaaaa",
  "config": {
    "enabled": 1,
    "profile_id": "aaaaaaaaaaaaaaaa",
    "profile_override_field_id": "site-picker",
    "fields": {
      "carrier.organisationName": "carrier-name",
      "carrier.meansOfTransport": "transport"
    },
    "waste_items": {
      "table_field_id": "waste-table",
      "fields": {
        "ewcCodes": "ewc",
        "wasteDescription": "description"
      }
    }
  }
}

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":"UK Digital Waste Tracking is not enabled for this account"}The account feature is disabled.
{"error":"missing or invalid parameter: form_id"}The converted Form ID is zero.
{"error":"form not found"}No Form exists with that ID.
{"error":"Digital Waste Tracking can only be configured on job forms"}The Form type is not 0.
{"error":"permission denied"}The required page action is absent; the shared permission helper retains its legacy roleless fallback.

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

Behaviour and edge cases

  • Returns the details object directly without ok. fields lists top-level fields with a nonblank meta.id as {id,name,type,form_id}; form_id is integer-converted extras.values even for a non-table field.
  • tables resolves top-level subform fields with a nonzero extras.values Form ID. Each item includes the main table field id/name, subform form_id and that subform’s stable fields. Missing child Forms are omitted; archived child Forms are omitted.
  • profiles contains only active profile id/name/environment and no API code/contact data. config is the stored digital_waste_tracking metadata array or []; defaults do not imply a complete/valid mapping.
  • No provider call, payload validation, record pagination or edit-lock check is performed by this read. Archived Forms are not exposed by this endpoint.

See it in Fieldmotion

CRM1

No direct CRM1 caller was found in the production JavaScript source. The operator workflow is implemented in CRM2.

CRM2

Open Forms > edit a Job Form > Digital Waste Tracking. CRM2 loads DigitalWasteTracking_formConfigGet to populate profile, main-field and waste-table mapping selectors.

Related endpoints