|
POST
|
Just out of curiosity, is your project setup to automatically allow edits to happen when the project is opened up and feature or table attributes can be updated? This could be causing your issue if the data source is something other than a feature class or table in either an sde or gdb. The other thing you mentioned is that you are working with a file table. If you could please explain that further then it might be easier for anyone or any of us to help you with your given situation? It sounds like your file table might be either an excel spreadsheet or some other table. If that is the case have you tried importing the table and see if the results are the same. You can use python to read other tables like excel but trying to run any edits on those tables or pull information from them could result in less than desirable behaviors. I have run into similar situations using external tables and usually importing them and then running python code on that table usually fixes the issue. It is often best to run python as a standalone script using the modules that are designed to read those file types instead of bringing them into pro. @HaydenWelch may be able to affirm this or have a different take than mine.
... View more
07-25-2025
07:48 AM
|
0
|
0
|
221
|
|
POST
|
Hi @LizAbbey, Here is my suggestion for simplifying and perhaps help troubleshoot your code at least for the validation. def updateParameters(self):
# Populate domain names from workspace (no type filtering)
db = self.params[0].valueAsText
if db is not None:
if '.sde' in db or '.gdb' in db:
domains = arcpy.da.ListDomains(db)
self.params[1].filter.list = list( set( [ d.name for d in domains for cv in d.codedValues for key, value in cv.items() if d.domainType is "CodedValue" and key in range(10) ] ) )
# Populate subtype field list with only Integer or SmallInteger fields
fcs = {}
if db is not None:
walk = arcpy.da.Walk(workspace, datatype="FeatureClass")
fcs = { filename : os.path.join( root, filename ) for root, directories, filenames in walk for filename in filenames }
self.params[2].filter.list = list( fcs )
if self.params[2].value:
table = self.params[2].valueAsText
if table in fcs:
table = fcs[table]
numfields = [ f.name for f in arcpy.ListFields(table) if f.type in ["Integer", "SmallInteger"] ]
if len( numfields ) > 0:
self.params[3].filter.list = int_fields
# My suspicion is the parameters need to be returned but I would need to double
# check that since it has been some time since I created a python tool.
# -- return self.params
return
This should at least help with the validation and maybe help get you in the right direction. I will need to dig in deeper for the other half but I think @HaydenWelch, @DanPatterson, or @jcarlson may have a better idea and also see if my suggestion is incorrect in some ways.
... View more
07-25-2025
06:17 AM
|
1
|
0
|
1198
|
|
POST
|
Yes. If you have editor tracking on or any modifiable date field then all you need to search for are the dates that are closely associated with whatever timeframe you specify. Python is incredibly flexible in terms of dates. Like I also said earlier, within the cursor you can add a SQL query expression to quickly filter records. For example, import arcpy
# Define the feature class or table
feature_class = "path_to_your_feature_class"
# Define the SQL query (e.g., select features where 'Population' > 1000)
sql_query = "Population > 1000"
# Use a SearchCursor to iterate through the filtered records
with arcpy.da.SearchCursor(feature_class, ["Name", "Population"], sql_query) as cursor:
for row in cursor:
print(f"Name: {row[0]}, Population: {row[1]}") This code was autogenerated by Microsoft's CoPilot but it should give some ideas. The SQL query can filter for only records that meet that criteria.
... View more
07-23-2025
01:55 PM
|
0
|
0
|
1660
|
|
POST
|
Hi @ChaceCarpenter, I would highly suggest checking out python cursors as to potentially help speed up some processes. Often times it is easier to only append the necessary data rather than bulk updates. In conjunction with the cursors you can also use SQL query statements to also help speed up the process as well.
... View more
07-23-2025
01:12 PM
|
0
|
1
|
1022
|
|
POST
|
A search cursor only accesses the data and does not apply any edits. @TonyAlmeida would be correct under the conditions of using either DeleteCursor or UpdateCursor. If you are looking to get all unique values first and then delete any that are duplicates, then you would need to set your script to look like the following. Feature = 'filepath of table or featurelass'
Searching = arcpy.da.SearchCursor( Feature, ['CommonIdField'] )
Updating = arcpy.da.UpdateCursor( Feature, ['CommonIdField'] )
Deleting = arcpy.da.DeleteCursor( Feature, ['CommonIdField'] )
# List comprehension of valid ids
ValidIDs = [ row[0] for row in Searching ]
# Delete rows based on matching ids in the list above
edit = arcpy.da.Editor(os.path.dirname(Feature ))
with edit as e:
with Deleting as cursor:
for row in cursor:
r = row[0]
if ValidIDs.count(r) >=2:
cursor.deleteRow(row)
ValidIDs.remove(r) This should at least help guide you in the right direction. @TonyAlmeida or @HaydenWelch please correct me if the above script is incorrect. I have used this structure in previous scripts but it has been almost a year since I last used python.
... View more
07-23-2025
11:19 AM
|
3
|
1
|
1681
|
|
POST
|
I think that is a great idea. Let me know if you are open to making it a joint blog or allowing some input from others to add to it. I often use the comprehension to create dictionaries while simultaneously having another dictionary to field map different schemas on the fly. That significantly reduces the amount of effort when it comes to migrating data or running specific analyses.
... View more
07-23-2025
07:50 AM
|
1
|
1
|
2296
|
|
POST
|
I agree with both @TonyAlmeida and@HaydenWelch. Using the 'with' statement is general best practice when it comes to using any cursor. Like @HaydenWelch said, the 'with' statement ensures the object deletes after the cursor finishes executing. The other thing you can include are break conditions to stop the execution earlier or pass conditions to skip over rows.
... View more
07-23-2025
05:14 AM
|
3
|
7
|
2309
|
|
POST
|
Here are my take on things that may add some value along with other posts. USE GIS AS A WORKFLOW NOT AS DATA STORAGE GIS is kind of the Swiss army knife when it comes to data collection, integrating data, and it can turn challenges into insightful or seamless workflows. Find areas where they are needing streamlined workflows or ways of collecting and displaying data that are otherwise difficult to get. Often the simplest workflows have the greatest impact to those who don't realize what they're missing out on. Utilize the various applications to showcase how they can work in conjunction with one another to demonstrate the flow of information and how it can provide accessible information. Showcase GIS capabilities that can help answer tough business questions. EMPOWER OTHERS TO LEAD AS EXAMPLES Rather than trying to get buy-in from major/leading individuals, instead work with smaller groups/departments and teach them how to use the applications effectively. It is easier to sell a process than a concept. REACH OUT TO OTHERS IN THE INDUSTRY Many do not understand how large the GIS industry actually is and what it all encompasses. There are many facets that, if implemented properly, can make the most arduous tasks seam simple. Find those in other fields, industries, or agencies that regularly use GIS and ask for small demonstrations to showcase what is all possible which can really help catch the attention of many stakeholders. AUTOMATE WHERE POSSIBLE The upkeep and maintenance of data is often the challenge, especially when organizations are small or just starting to implement GIS. If data maintenance is a concern, it often helps to learn skills such as SQL, Python, or lately Arcade to showcase how the data can be maintained using fewer resources. TEACH OTHER USERS The more people that you can get to work with GIS the better. Start by teaching others within your organization how to use the simple things. When they start to have more desire to work with it, the easier it will be to get others on board.
... View more
07-22-2025
02:46 PM
|
4
|
1
|
3038
|
|
POST
|
Hi @Andrew-Bowne, Just for clarification purposes. Are wanting a group filter in an application, a map, or some other interactable source? Without knowing which application you are referring to it is difficult to determine whether the capability exists or not.
... View more
07-22-2025
12:39 PM
|
0
|
1
|
1149
|
|
POST
|
Hi @AndrewRudin1, I have ran into this issue several times even though we are on 10.9.1 but I would recommend checking each of the following: Check the compatibility version of your enterprise with the rule version. The rules will show you the lowest compatible version of enterprise it will work with, and if the rule is set for a higher version than your enterprise then that might be the issue. Another issue is there could be a potential bug where the syntax checks out and the edits can be applied in pro, but once it is turned into a service, then the issues arise. Check the server logs in the server manager to see what the error is. If you get the message "script error at line 0" then that is a possible sign that there is a bug. Check if "Exclude from application evaluation" is checked if it is accessing $originalfeature or some other feature or table.
... View more
07-22-2025
12:31 PM
|
0
|
0
|
1997
|
|
POST
|
Hi @aolson, You may need to modify the arcade expression to reset for every month, otherwise it seems it does the bi-weekly for the entire year.
... View more
07-22-2025
10:10 AM
|
0
|
0
|
1592
|
|
IDEA
|
Hi @Ed_, Just to get a better understanding of the idea, are you specifying to create a collapsable filter group that can be added to the header?
... View more
07-22-2025
10:05 AM
|
0
|
0
|
529
|
|
IDEA
|
Another workaround for something like this, which I am currently using, is to create a separate set of data in the data expression, such as a table, and using that table to filter the map and other widgets. You can set the table to show the ranges based on the data or custom data with one field to use as labels and the other as values.
... View more
07-22-2025
10:00 AM
|
0
|
0
|
889
|
|
IDEA
|
I have figured out a workaround to this by simply setting the values to look for the first record that matches the filter criteria set and then set all records that get updated to the attributes of the first returned record. This nullifies the cyclical update issue as I have come to find out.
... View more
07-22-2025
09:51 AM
|
0
|
0
|
716
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-07-2026 01:36 PM | |
| 1 | 02-10-2026 06:09 AM | |
| 1 | 03-04-2026 01:08 PM | |
| 1 | 02-24-2026 12:59 PM | |
| 3 | 03-03-2026 10:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|