Column order in CSV export

I have a need to export data from my app into a pre-defined CSV format for a legacy system. The data has to be in a specific column order. It appears that Bubble exports CSV data in alphabetical column order.

So is there a way to adjust something to account for this?

Marc

While writing this post I thought of a way to do this that was awful, but I thought would work and that was to rename my columns with additional junk on the front to alphabetize it in the order I wanted. So if I had

FirstName
LastName
MiddleName

I would rename them

100_FirstName
101_MiddleName
102_LastName

but that doesn’t work. It appears Bubble remember the original column name and keeps things in THAT order. yuck

Can anyone at Bubble comment on the order of columns issue?

Marc

2 Likes

Has anyone had to deal with this? I sent a request to support for a definitive answer on how the system works and how it is supposed to, but I am wondering if anyone else found a way around this limitation.

Sometimes a good night’s sleep is all you need. I woke up this morning with a work-around to this issue. I tested it and it works. Given my specific use case, it will be fine. It may not be as useful for other use cases.

Since I am just creating a table (thing) to house data for export purposes, ALL of my fields can be text fields so I just figure out how many fields I am going to need and create them all as text fields, named like this:

col001
col002
col003

etc. I can then do one of two things. I can leave them be and just assign the values I want into the column I want OR I can now rename the fields. Since Bubble retains the original name as the ID, they will stay in the order I intended. To prove this I created a quick table and put data in it and exported it WITH the “Include labels in first row” option checked and the “Use field captions” option unchecked. The export looked like this

col001_text col002_text
value value

I then changed the column names

col001 = firstName
col002 = email

If the export used the new names, since it does them by alpha order, email would be first, but instead I got the exact same export. The column headers remained col001_text and col002_text.

So, there ya go. As long as Bubble continues to retain the original field name for use in sort order, this work around will…work.

Marc

Even with this work-around, I still think the csv export feature should have a col index function. I should not have to go through all this nonsense to export data in a specific order.

8 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.