Copying the order of one view to another

Using the API, is it possible to copy the field order of one view into another view? I want an easier method to reorder fields. please help.

Using the API, you can get the field options of the first view as described here: get_database_table_view_field_options

Then, as you can see from the payload properties, if you send the data you get to update_database_table_view_field_options of the second view, you’ll get an identical copy with the same field orders, hidden fields, aggregations, column width, etc.

Please remove all the unwanted attributes from the payload to match just the order.

You can also obtain the same result without the API clicking on “Duplicate View” from the view context menu.

Or you can do it with the API by just calling https://api.baserow.io/api/database/views/{id of the original view}/duplicate/. This also keeps the fields in the same order

1 Like

David, Thank you, this is the route that worked. I had to get the name based on field id.

Thanks