# Sort Columns in a specific Order Ignition Perspective

**URL:** <https://forum.inductiveautomation.com/t/sort-columns-in-a-specific-order-ignition-perspective/102484>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [February 18, 2025, 1:14pm UTC](https://forum.inductiveautomation.com/t/sort-columns-in-a-specific-order-ignition-perspective/102484 "2025-02-18T13:14:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farhan\_Basheer](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/farhan_basheer/32/66759_2.png) [@Farhan\_Basheer](https://forum.inductiveautomation.com/u/Farhan_Basheer)\
**Post date:** [February 18, 2025, 1:14pm UTC](https://forum.inductiveautomation.com/t/sort-columns-in-a-specific-order-ignition-perspective/102484/1 "2025-02-18T13:14:28Z")

</div>

I have a table with **n** number of columns.  
Few of these columns have the `Field` and `Title` property in `Words` all other are `Numbers`. Now when i populate this table, the columns with `Number` comes first and the columns with `Words` go to the last. I want to show the columns with the `Words` before the `Numbers`. I am not using bind data or named query. Everything is setup by the Python Script.

I have defined the columns order in the `Columns` property of the Table.

When I execute the same query in the workbench the intended order came up.

Is there a way to apply the order I need?

 ![{3042C8A8-1ACD-4425-904E-1C439C5D7922}](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/d/0dd2c23ab74b935662e3b9bf9af7ff77767bed8b.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 18, 2025, 1:24pm UTC](https://forum.inductiveautomation.com/t/sort-columns-in-a-specific-order-ignition-perspective/102484/2 "2025-02-18T13:24:47Z")

</div>

Have you specified the query column name in each `columns.x.field` property?

---

<div class="post-metadata">

**Author:** ![Farhan\_Basheer](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/farhan_basheer/32/66759_2.png) [@Farhan\_Basheer](https://forum.inductiveautomation.com/u/Farhan_Basheer)\
**Post date:** [February 18, 2025, 1:42pm UTC](https://forum.inductiveautomation.com/t/sort-columns-in-a-specific-order-ignition-perspective/102484/3 "2025-02-18T13:42:17Z")

</div>

Yes I have.

 ![{12538D9C-E527-44C2-8709-5023F86DEF1D}](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/0/f00aaee642c922942669cf57be28a0c774b38fd0.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 18, 2025, 1:54pm UTC](https://forum.inductiveautomation.com/t/sort-columns-in-a-specific-order-ignition-perspective/102484/4 "2025-02-18T13:54:25Z")

</div>

OK, I see what you meant (and wrote!) in the original post.

[Perspective - Table | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-display-palette/perspective-table#properties) says,

> - **field** : A string that matches this column config with a table column. This string must correspond to the default column name of the column. Value is string.

I think you're going to have to do some trickery.

- Get the query to rename the columns using the `AS` function and add a leading alpha character.
- Use those names in the `columns.x.field` properties.
- Use the `columns.x.header.title` property to display just the number.

---

<div class="post-metadata">

**Author:** ![Farhan\_Basheer](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/farhan_basheer/32/66759_2.png) [@Farhan\_Basheer](https://forum.inductiveautomation.com/u/Farhan_Basheer)\
**Post date:** [February 18, 2025, 1:57pm UTC](https://forum.inductiveautomation.com/t/sort-columns-in-a-specific-order-ignition-perspective/102484/5 "2025-02-18T13:57:28Z")

</div>

Thought of that, I thought maybe there is a way to define the custom order to put the `columns.x.field` with `word` before the `numbers` in ignition.

Anyways thanks. I will update the query.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 18, 2025, 2:11pm UTC](https://forum.inductiveautomation.com/t/sort-columns-in-a-specific-order-ignition-perspective/102484/6 "2025-02-18T14:11:59Z")

</div>

No, I suspect that you've broken the table functionality by using a number in the data column name. If you're using JSON rather than a dataset the props editor won't even let you specify a value name beginning with a number.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/6/0608e5c737cfc43a04dbf8b02b86cf71f94bc33c.png)  
_Figure 1. Image source: [JSON.org](https://www.json.org/json-en.html)._

According to the image the key must be a string.

Ignition seems to tolerate incorrect JSON to some extent but the table can't make any sense of the columns if it's invalid. I don't know what happens with a dataset.

---

<div class="post-metadata">

**Author:** ![Farhan\_Basheer](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/farhan_basheer/32/66759_2.png) [@Farhan\_Basheer](https://forum.inductiveautomation.com/u/Farhan_Basheer)\
**Post date:** [February 18, 2025, 2:18pm UTC](https://forum.inductiveautomation.com/t/sort-columns-in-a-specific-order-ignition-perspective/102484/7 "2025-02-18T14:18:36Z")

</div>

Oh I see, that's why it was working perfectly with the `String` field names and start behaving abnormally when I changed `string` to `number`. Thanks a lot for the in dept explanation.
