Mautic Community Forums

Order Number of a mautic form fields is not being respected in the API call

Problem

If I change the order number of the mautic form field in an API call, it does not changes the order of the field.

"fields": [
            {
                "label": "expTest",
                "showLabel": true,
                "alias": "expTest",
                "type": "freetext",
                "defaultValue": null,
                "isRequired": false,
                "validationMessage": null,
                "helpMessage": null,
                "order": 3,
                "properties": {
                    "text": "la bla bla bla"
                },
                "validation": [],
                "labelAttributes": null,
                "inputAttributes": null,
                "containerAttributes": null,
                "leadField": null,
                "saveResult": true,
                "isAutoFill": false
            }
]

As it can be seen in the above JSON code, Just want to edit the order of a Field, but it is not working.
Is there any solution for this or this can be considered as an improvement or bug in API ?

I do not think “order” attribute corresponds to order in JSON array. As I understands it corresponds to order in GUI.

Why would order in JSON array matter since you can always check alias when dealing with integrations (APIs) before you process incoming data?

@mzagmajster If I change order directly in the database then it also changes the order but not through the API. It is not only the GUI thing, it saves the order in the database. So, in my opinion, this should also be done through API.

I want to reorder the fields using API. But I am unable to do that. :slight_smile:

@abdulwahab But is there a specific reason for this feature/requirement or is it just for convenience ?

@mzagmajster thanks for your reply. Yes because I want to update my form and also want to rearrange the order number of the fields using API. It does not look nice to Update complete form using API and for order number I will go to the Mautic and arrange my fields separately.

Oh, I see now, that we are talking about form fields not fields on Mautic contacts page. All clear now.

yes, Form Fields. :slight_smile: