Re-ordering fields in Pro?

802
4
03-04-2017 08:34 AM
MichaelMiller8
New Contributor II

Is it possible to permanently re-order the fields in a feature class? I seem to recall this may be a new function in Pro but can't discover how to do it.

0 Kudos
4 Replies
DanPatterson_Retired
MVP Emeritus

https://community.esri.com/ideas/1362 is the idea that is still under consideration for ArcMap, it isn't in Pro yet, but Alter Field exists in 10.4+ and PRO 1.3+ (IMS).  You are probably looking for the ability just to rearrange the table as you see fit and it will stick without creating a new feature class... not going to happen quite yet, but there are workarounds if this is an issue and something that you would do often .

MichaelMiller8
New Contributor II

Thank you very much Dan, your expertise is always helpful!  Not creating a new feature class would be great, but I have tried several methods to save the re-ordered fields: export as shp file, export as new FC, etc.

I have had success building a completely new table in Excel (with properly ordered fields) and joining to a "skeleton" shp, but searching for a better workaround.  It sounds like I may be missing a common approach for this.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Michael, I use Numpy for this, there are a number of posts on my blog dealing with numpy and tabular data.  The recfunctions module in numpy has methods for creating fields, joining arrays together and arcpy's Numpyarraytofeatureclass and Numpyarraytotable allow you to work with tabular data.  I just generally find it quicker to export the non-geometry portion of a featureclass/shapefile table to an array, rearrange the columns the way I want (even add new ones with calculations) and bring the array back in as a table, do a join on the objected field and save to a new featureclass.  With simple geometry, you can even send over the geometry attributes, do all the stuff in numpy an bring it back into arcmap.  The Py_links has a lot on using numpy with arcmap, the contents are not in conceptual order or order of difficulty.

Some day, I will finish tinkering with the numpy toolset and post it on the Code sharing site (you might have a troll around there too)

MichaelMiller8
New Contributor II

Thanks again Dan.  I'm a Numpy novice but keen to do more.  It sounds like we both have similar non-Numpy workarounds for this for the fast turn-around stuff.

As always, your insight is appreciated!

0 Kudos