Select to view content in your preferred language

Setting fields for regular exports

709
4
Jump to solution
04-07-2022 08:18 AM
SimonCrutchley
Frequent Contributor

I'm wondering if there is a way to save the export fields to make life easier when regularly exporting a subset of a dataset. My situation is this; I have a pretty massive dataset (c400,000 features), which, because of the need to create various links in pop-ups within AGOL has over 150 fields. Academics and other customers want to use this data, and as a publicly funded body we need to provide it, but obviously they don't need all the additional fields as they're not creating pop-ups. As a result, when I provide this data I need to select the 'Fields' option in the Export and delete c130 unnecessary fields. This is pointless and time-consuming, so I wondered if there's a way to save a template, or some such, so that when I want to export this dataset I don't need to do this multiple times. I've looked at Definition queries etc but they don't seem to help. I realise that I could always save a 'stripped down' version of the dataset, but at 400,000 features this would still be rather large and seems like an unnecessary duplication, if there is another way around the problem. 

Thanks

0 Kudos
1 Solution

Accepted Solutions
RhettZufelt
MVP Notable Contributor

Yes, you can edit the script, it is just text and can easily be modified with different path.  Script can then be run from within Pro using the python window or a Notebook.

However, since you are not familiar with python, for this operation, you might want to look at creating a Model.

All you would need to do is add Feature Class To Feature Class tool and configure the Fields section to only include what you want.  Save the model, then all you need to do is edit the model, double click on the FC 2 FC tool, change output location and hit "Run".

RhettZufelt_0-1649431151460.png

 

R_

 

View solution in original post

4 Replies
RhettZufelt
MVP Notable Contributor

If it's always the same fields, open the project you last Exported and deleted the c130 unnecessary fields, go to the History tab, right click the Export and copy to python script.

Now you have a one liner already set up to exclude the fields when you export, just run the python snippet.

could also make a model and save it so you only have to set it up once.

R_

 

0 Kudos
SimonCrutchley
Frequent Contributor

Thanks for that. Sorry to ask a very basic question, but how do I actually run the python snippet, and can I edit it first? Although I will want to use the same fields, and the same underlying database, I'll want to export to different places each time. I tried 'load', but that seems to be a query, not a script. Ta

0 Kudos
RhettZufelt
MVP Notable Contributor

Yes, you can edit the script, it is just text and can easily be modified with different path.  Script can then be run from within Pro using the python window or a Notebook.

However, since you are not familiar with python, for this operation, you might want to look at creating a Model.

All you would need to do is add Feature Class To Feature Class tool and configure the Fields section to only include what you want.  Save the model, then all you need to do is edit the model, double click on the FC 2 FC tool, change output location and hit "Run".

RhettZufelt_0-1649431151460.png

 

R_

 

SimonCrutchley
Frequent Contributor

Brilliant. Just what I needed.

Thanks 🙂

0 Kudos