I have a table with columns that are fetched from a datasource in a random order. I want to programmatically sort them so they are displayed in a specific order, without using the UI. Additionally, I want to freeze certain columns in place while still sorting the rest. This would be helpful for cases where the columns are dynamic and need to be sorted in a specific way. I believe there may be an 'order' property on the column object that can be accessed programmatically to solve this issue, and I've filed a feature request for it.
The expert then suggested that there must be an 'order' property set on the column object when the user drags the column in the properties pane. Having access to that property programmatically could solve the issue. They provided a link for the requester to file a feature request/bug report, and mentioned that internally the column order is stored in the columnOrder list within canvas.json of the page.
In summary, the current solution is to manually reorder the columns in the table property pane or to file a feature request to access the column object's 'order' property programmatically. The expert has provided a link for the requester to file the feature request/bug.