I'm trying to dynamically build a frontend form based on a Matrix field. I'm iterating over the entry.aMatrixField.customFields array which returns me an array of field objects in Twig. The field objects however have null assigned to required and sortOrder properties. These fields are crucial to building the form. Am I missing something or is this a bug? Are there any other ways to query the customFields object?

Example field object:

    "placeholder": "",
    "code": "",
    "multiline": "",
    "initialRows": "4",
    "charLimit": "",
    "columnType": "text",
    "id": "13",
    "dateCreated": {
        "date": "2019-08-31 18:58:44.000000",
        "timezone_type": 3,
        "timezone": "America/Los_Angeles"
    "dateUpdated": {
        "date": "2019-09-02 02:10:06.000000",
        "timezone_type": 3,
        "timezone": "America/Los_Angeles"
    "groupId": null,
    "name": "First Name",
    "handle": "firstName",
    "context": "matrixBlockType:5efbc961-a31e-4b9c-b43b-22c371b61ba8",
    "instructions": "",
    "searchable": "0",
    "translationMethod": "none",
    "translationKeyFormat": null,
    "oldHandle": null,
    "oldSettings": null,
    "columnPrefix": "field_player_",
    "uid": "752e8d21-449a-4e4d-bbab-22dc160e4553",
    "layoutId": null,
    "tabId": null,
    "required": null, // should be 1
    "sortOrder": null // should be an integer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.