Select to view content in your preferred language

ArcGIS Online: Reordering Fields in Hosted Feature Layer from Data Page

16089
15
04-23-2017 03:13 PM
HenryHaro
Deactivated User

Hi all, I'm using ArcGIS Online and I'm wondering if there is a way to rearrange the fields of a hosted layer file. I know you can change their order and if they're displayed or not when configuring layer attributes in a Web Map, but I'm curious if there is a way to change them in the Hosted layer file itself so that the order is reflected when the layer is imported into another map. So far I've had to reorder the fields every time I start a new map and it's become really time consuming. Any hints would be appreciated. Thanks!

15 Replies
BigLouC
Frequent Contributor

Not sure if this helps anyone, but using ago assistant, you can edit the JSON to rearrange the fields then save your change. I have done it with views, because you cant rearrange fields even there. So editing the JSON helped out. Just make sure you are careful when editing with the brackets and commas.

AYamaguchi_UGRWCD
Occasional Contributor

Can you please post instructions for your method (in simple enough terms for someone who doesn't know what JSON stands for)? Thank you!

0 Kudos
GAVINMAURER
Emerging Contributor

I just tried this, rearranged the order of the fields within the JSON but it didn't change the order of anything within feature editing fields in my AGOL map. You are saying that it worked for you?

0 Kudos
AYamaguchi_UGRWCD
Occasional Contributor

Can you please post instructions for your method (in simple enough terms for someone who doesn't know what JSON stands for)? Thank you!

0 Kudos
GAVINMAURER
Emerging Contributor

Not sure if this will work for everyone but for my application I was able to solve this problem by exporting my data layer as a FGDB from AGOL, import it into Arc Pro, edit the attribute table within ArcPro and then export it back out as a new web layer and reupload it to my AGOL map. I had to redo all of my symbology and what not but I was at least able to reorder my features and now I know not to screw it up again!

fklotz
by
Frequent Contributor

Re-order your fields in ArcGIS Online by configuring visualization of the layer

Note: while this does not change the actual field order in the data store that ArcGIS Online loads the data from, it does change the order of the fields for the table and popup for the layer. 

Method using the ArcGIS Online interface

  1. Go to your item in ArcGIS online.
  2. Select "Data" in the Item navigation bar
  3. Select the "Fields" button
  4. For each field, ensure the field is configured: set up the Alias name and for key fields, set the Field Value Type. Feel free to add a description to properly document that field. Create a domain if needed.
  5. Click the "Visualization" item in the Item nav bar
  6. In the map table of contents, select your layer, then click the "Fields" button on the far right (assuming you are using the newer map viewer).
  7. click on each field and check the "Display Name" (it will be the Alias name for the field) and set up the display format: e.g., for decimal fields, set the number of decimals and if you want the thousands separator. Setting this on the visualization settings means you configure it once and it will show everywhere you add the layer in the future, so do it now. If you published the layer from ArcGIS Pro, many of these settings may already be set if you had set them in Pro first.
  8. Click on the popup.
  9. Due to someone's grand idea that fields should be listed alphabetically in ArcGIS Online, your fields may not be listed in your dataset order in the "Fields List". If they are not, hit the "Select fields", then "Select all", then "Deselect all", then "Select all" and they will now show in your database order. Remove any fields you don't want to see then click Done. Now you can drag any fields to their correct locations in the "Fields list" and save your popup. Click Save to save the configuration so far.
  10. over on the left-hand side, click the ... to the right of your layer name and choose "Show table"
  11. click the Settings (gear) button to open the "Field Visibility" popup.
  12. configure the field visibility the same way as you did the pop up to get the right fields visible and to get them into the database order. Close the "Field Visibility" dialog.
  13. Now the painful part. For any field that is out of order, click the field header and drag it into the correct location. Save the visualization configuration.
  14. load your layer into a new map to view your handywork.

Note that we did not have to create, calculate, and delete any fields and we did not have to download and re-publish the data. We did not need to know python, JSON, or REST end points.

You can do this stuff via the ArcGIS Assistant and/or the ArcGIS API for Python and/or REST endpoints, and if you have that skillset, excellent! Sometimes I do field re-ordering as listed above, sometimes with the ArcGIS API for Python, and sometimes with the AGO Assistant - depending on how much there is to do.

The ArcGIS Assistant is a fantastic tool, but you do need to be careful. I recommend copying the existing data configuration ( @AYamaguchi_UGRWCD: this format is the JSON you were asking about) and saving it as a text file somewhere so that you can re-apply it if you make a mistake. Be careful, you can mess up your dataset with the programmatic methods, but not with the steps I outlined above.  If you do mess up, you can re-apply the last working copy if you saved the JSON to a text file.

Farley