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

**URL:** <https://forum.mautic.org/t/order-number-of-a-mautic-form-fields-is-not-being-respected-in-the-api-call/20863>\
**Category:** Product Support\
**Tags:** mautic-3\
**Created:** [September 14, 2021, 10:00am UTC](https://forum.mautic.org/t/order-number-of-a-mautic-form-fields-is-not-being-respected-in-the-api-call/20863 "2021-09-14T10:00:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![abdulwahab](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/abdulwahab/32/505_2.png) [@abdulwahab](https://forum.mautic.org/u/abdulwahab)\
**Post date:** [September 14, 2021, 10:00am UTC](https://forum.mautic.org/t/order-number-of-a-mautic-form-fields-is-not-being-respected-in-the-api-call/20863/1 "2021-09-14T10:00:19Z")

</div>

**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.

```auto
"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 ?

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [September 14, 2021, 6:01pm UTC](https://forum.mautic.org/t/order-number-of-a-mautic-form-fields-is-not-being-respected-in-the-api-call/20863/2 "2021-09-14T18:01:43Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![abdulwahab](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/abdulwahab/32/505_2.png) [@abdulwahab](https://forum.mautic.org/u/abdulwahab)\
**Post date:** [September 15, 2021, 8:04am UTC](https://forum.mautic.org/t/order-number-of-a-mautic-form-fields-is-not-being-respected-in-the-api-call/20863/3 "2021-09-15T08:04:23Z")

</div>

@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. 🙂

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [September 15, 2021, 8:22am UTC](https://forum.mautic.org/t/order-number-of-a-mautic-form-fields-is-not-being-respected-in-the-api-call/20863/4 "2021-09-15T08:22:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![abdulwahab](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/abdulwahab/32/505_2.png) [@abdulwahab](https://forum.mautic.org/u/abdulwahab)\
**Post date:** [September 15, 2021, 8:37am UTC](https://forum.mautic.org/t/order-number-of-a-mautic-form-fields-is-not-being-respected-in-the-api-call/20863/5 "2021-09-15T08:37:13Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [September 15, 2021, 8:46am UTC](https://forum.mautic.org/t/order-number-of-a-mautic-form-fields-is-not-being-respected-in-the-api-call/20863/6 "2021-09-15T08:46:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![abdulwahab](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/abdulwahab/32/505_2.png) [@abdulwahab](https://forum.mautic.org/u/abdulwahab)\
**Post date:** [September 15, 2021, 8:53am UTC](https://forum.mautic.org/t/order-number-of-a-mautic-form-fields-is-not-being-respected-in-the-api-call/20863/7 "2021-09-15T08:53:07Z")

</div>

yes, Form Fields. 🙂
