Select to view content in your preferred language

Exclude objectid field when running excel to table?

1104
4
Jump to solution
11-14-2022 06:12 AM
RandyMcGregor3
Frequent Contributor

I have a script that selects records in a table and exports them as excel files. The fields are very important and the 'objectid' is unwanted. Is there a way to control which fields are output when running 'ExcelToTable'?

Thank you,

Randy McGregor

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
AyanPalit
Esri Regular Contributor

@RandyMcGregor3 I assume you have a geodatabase table that needs to be exported as Excel file.

  1. Add table to ArcGIS Pro and right-click access to Data Design > Fields
  2. Uncheck the visible checkbox for undesired fields and save the table design.  
  3. Run the GP 'Table to Excel' and only the visible fields will be included in the export. 
Ayan Palit | Principal Consultant Esri

View solution in original post

4 Replies
AyanPalit
Esri Regular Contributor

@RandyMcGregor3 I assume you have a geodatabase table that needs to be exported as Excel file.

  1. Add table to ArcGIS Pro and right-click access to Data Design > Fields
  2. Uncheck the visible checkbox for undesired fields and save the table design.  
  3. Run the GP 'Table to Excel' and only the visible fields will be included in the export. 
Ayan Palit | Principal Consultant Esri
RandyMcGregor3
Frequent Contributor

The tool converts an excel file to n fgdb table first, then exports multiple excel files from that table. Might work to have it be two step  process:

  • Convert to table
  • set up fields
  • run script.

Ok, that's three steps.

0 Kudos
TylerT
by
Frequent Contributor

The ArcGIS API for Python be well suited to this sort of transformation.  Read the feature class into a spatially enabled dataframe, do stuff (filter, etc), then write to excel.  Docs at https://developers.arcgis.com/python/.

HTH

Tyler

RandyMcGregor3
Frequent Contributor

Thanks, but I'm not quite ready to tackle ArcGIS API for Python. I've dabbled and it looks very powerful. Trying to stick with a out of the box tools (in arcpy) for this one.

0 Kudos