How to paste in a long list of data to existing polygon features?

569
7
01-15-2024 07:55 AM
Labels (3)
danielholtz
New Contributor

Hi, super appreciate any help.

I need to select by 1 attribute but i have a long list of data, say 20-100 items. Can I copy and paste my long list from excel into a tool or something to select all of them? In other words, if I could select all the fields i need to then add an attribute to, i need an easy way to select just the polygons i want from a long list.

I tried the select by attributes button/tool but dont know how that would work for my needs. Also thought the attributes button/panel might work but all that comes up is to click on the items.

Here is more detail:

1. i have over 800 polygons that represent fields on my farm. Each polygon has a field number like A100, B200 etc. I have excel data that i need to now insert/past from excel into the polygon attribute table. How do I match up the field name to the next data point say variety of plant, or number of plants, etc. (in other words, every polygon needs a variety or other data added to the attribute table) Can I past a column of data from excel into arcgis pro?

Separate question would be is there a GIS expert that helps consult or solve problems/improve my GIS skills available either my specific topic or hourly?

Thank you,

Daniel

0 Kudos
7 Replies
LindaWilliams1
Occasional Contributor

I would suggest running Excel to Table on your spreadsheet and then use the Join Field tool on the polygon feature layer using the field number as the Input Join Field. This will bring all of the fields (or just the ones you select) from your spreadsheet into the polygon feature's attribute table

danielholtz
New Contributor

yes, awesome. that sounds great! Still looking for a simple way to just select based on a list.

Thank you!

0 Kudos
DavidPike
MVP Frequent Contributor

I'm not really following what you need from your explanation.  Linda's answer seems to be the best option, but after re-reading your question there may be more to your data format.

It might help to share some sample screenshots, as the question is not the clearest (to me at-least).

Bud
by
Notable Contributor

I'm not following either.

But it brought to mind something related. If I have a list of IDs in Excel that I want to use in Select By Attributes or a definition query in ArcGIS Pro, then I use Excel to generate a SQL expression.

Like this (video):

="'"&A1&"',"

That's pretty laborious, though. With a short list of IDs, it might just be easier to write the SQL expression manually in Notepad.

Hopefully, someone knows of a better way.

Related: Creating definition query from selected features using ArcGIS Pro

0 Kudos
danielholtz
New Contributor

Agree, Linda's answer and the join field tool is awesome, but what if all i need to do is export say 10 fields as a new layer, so all i want to do is select them so i can export feature. The select by attribute works, but i have to select each field from the list of 800 one by one. So i figured there would be a quicker solution. Bud is on the right track and I will try that. Thank you!

Here is a screenshot of me trying to fill out the select by attribute that is very slow. It also shows my list coming from excel that I would love to copy and past to somewhere to easily select all of those.

 

danielholtz_0-1705359494014.png

 

0 Kudos
DavidPike
MVP Frequent Contributor

A simple way which would only take a few minutes would be to use an excel formula to take your strings into a format such as below (slide the syntax bar to 'SQL' rather than clause mode)

 

Field_name IN (
'X100',
'Y200',
'Z200'
)

 

 You can generate the string format using a simple excel formula such as below (replace A1 with your cell then drag the formula down for the other cells.

 

"'"&A1&"',"

 

 Copy the cells from the excel and paste them into the SQL IN statement (don't forget to remove the last value's comma for syntax)

 

Edit - have realised this is an inadvertent copy of @Bud  's solution above. 

Bud
by
Notable Contributor

It's kind of funny that you and I provided pretty much exactly the same solution.

0 Kudos