|
IDEA
|
I've had at least one project that would ideally use the standard editing tools (and Field Maps) get converted to a Survey123 hackjob workflow due solely to a lack of a multiple-choice domain. Making this a standard geodatabase feature would lead to greater adoption in other parts of ArcGIS. While I'm here, here's a user story to help development: Bob needs to collect which birds and which fish are in all the lakes in the city park. The lake assets are digitized ahead of time and he only needs the latest state, so a multi-choice domain for the "birds" and "fish" fields on those lake polygons are all he needs. The "birds" field is already there as a text field and can't be altered, so Bob creates a "BirdSpecies" multi-choice domain in the Enterprise Geodatabase for "Text" fields. He enters a 2-character code for each species and a full text description. The "fish" field will be a new field and Bob wants to keep his data fast and compact, so he creates a "FishSpecies" multi-choice domain for "Short" fields. Bob enters the description of each species and Pro auto-populates a numerical code, ensuring that for each description "n" the code is "2^(n-1)". Bob can alter the codes by hand but Pro will ensure that no codes have non-power-of-2 values. It will also ensure that no more than 16 codes are assigned for this "Short" domain; Bob can step up to a "Long" type if he needs up to 32 choices. Bob stops the web services, adds the new field, applies both domains and starts the services back up. The REST endpoints for these services now show the multi-choice domain options for the appropriate fields. Alice is configuring the Field Map for this collection project. When she adds the lake layer to the map and configures the smart forms the "birds" and "fish" fields now have a "checkbox" form element by default. Alice can change this from a dropdown list to a radio list if needed. She can also write Arcade expressions using the new "HasCodeInField" function to hide field groups or calculate other fields if a certain bird or fish is selected in the form. Steven has to create a Survey123 form for the lakes to meet a client mandate. He tells Survey123 Connect to prep the form based on the "Lakes" layer and the form automatically has a "select_multiple" question and matching list for the "birds" and "fish" fields. Ricardo collects a new lake in Survey123 and updates an existing lake in Field Maps. In both cases, the raw value of the "birds" field is all the codes in a comma-separated list, just as Survey123 does with a "select_multiple" question on a domain-free text field, and the "fish" field holds the bitwise OR of all choices as a single number. Veronica has a custom export script tool that needs to handle these new domains. During the export, her script grabs the "Domain" object for each field and calls the "codeToDesc" function with the raw value as a parameter to get a list of descriptions that she can process further. She could also use the "arcpy.da.ConvertDomainCodeToDesc" function with the raw value, the workspace path and the name of the matching domain to acheive the same goals.
... View more
07-16-2024
11:28 AM
|
0
|
0
|
3195
|
|
POST
|
Please make use of code sample formatting for Python code to avoid indent ambiguity, like so: with arcpy.da.SearchCursor(feature_class, ["*"], where_clause) as cursor:
for row in cursor:
row_value = row[cursor.fields.index("LAST_UPDAT")]
rowdate_only = row_value.date() # This fails What's the data type of "LAST_UPDAT"? If it's a string you'll need to use the this method, if it's an integer that represents a UNIX timestamp try something in this StackOverflow thread, and if it's a custom integer representation then parsing is non-trivial.
... View more
06-27-2024
04:40 PM
|
1
|
2
|
1268
|
|
POST
|
Supporting multiple trips to the same survey record is a common workflow in my org. We point our survey forms to feature services that use registered EGDB data so we can use attribute rules with a state field to advance the form along as certain key fields are edited. If you don't have access to that, some things you can try are: Using the "deviceid" field type, this should have a valid value on mobile and not on the web. Make sure you bind the field type to "null" so it doesn't get into the actual data. You can also try adding your objectid or globalid field directly -- again, bind this to "null". Brand new forms should not have the values populated while editing existing forms will.
... View more
06-20-2024
11:47 AM
|
0
|
0
|
3838
|
|
POST
|
Try altering your script to output the new field alias names only, then run the alter field tool by hand for a few of them using that output. Does it fail silently again, or do you get an error?
... View more
06-20-2024
09:10 AM
|
0
|
1
|
4457
|
|
POST
|
Odd, this expression works in the Map Viewer for Enterprise 11.1 just fine. Does adding an explicit "return" keyword at the start of line 2 fix things?
... View more
06-20-2024
09:04 AM
|
0
|
0
|
1153
|
|
POST
|
Here's what I'm using on my current projects, this requires using Arcade to make a special field for the URL: "https://survey123.arcgis.app?itemID=blahblahbalh&action=edit&update=true&q:globalId=" + Lower(Mid($feature.GlobalID, 1, 36)) I think you should be able to swap out the first part of the URL with the other link type, depending on what works better for your set of devices. As for that GlobalID part, this removes the curly braces and lowercases the letters, this should avoid any issues with a GlobalID in a URL.
... View more
06-20-2024
08:25 AM
|
0
|
0
|
1347
|
|
POST
|
If you have a bunch of features and you want to see their spatial relation to another set of features just use the Spatial Join tool. You can run through the results with a cursor but it'll run much faster, especially as the size of your datasets expand.
... View more
06-18-2024
08:29 AM
|
0
|
0
|
1408
|
|
POST
|
If you make "params" a proper function parameter and pass it in every time does that help?
... View more
06-12-2024
03:05 PM
|
0
|
0
|
905
|
|
POST
|
I assume you have, say, 3 category selectors (A, B, C) and you want anything that matches A OR B OR C, right? I haven't played around with data expressions much but in theory you can combine all three fields into one category by getting the cross product of their unique values, then repeat that in the data expressions for the data you want to filter. Now that you have matching key fields everywhere you can have a single multi-select category filter that works for everything.
... View more
06-12-2024
01:20 PM
|
1
|
0
|
877
|
|
POST
|
If you pick regular JSON then it'll assume the file is using ESRI's internal JSON format, so it won't produce any meaningful results with GeoJSON.
... View more
06-10-2024
12:46 PM
|
0
|
0
|
4888
|
|
POST
|
I grabbed some data of my own and it ran through JSON to Features with the geometry type set to Point for one set of features and Polyline for another. The points were attributed and the lines were not. Maybe try that tool and see if it meets your requirements.
... View more
06-10-2024
12:17 PM
|
0
|
2
|
4897
|
|
POST
|
That snippet is an error prone and roundabout way of doing: #Extract Tax Parcels from Parcel Editing (Feature Service on Portal)
field_name = "Name"
source = r"UPDATEDENTERPRISE/HOSTED//FEATURELAYER/FeatureServer/0"
fc = r"UPDATEDENTERPRISE/HOSTED//FEATURELAYER/FeatureServer/0"
CSVFile = r"S:\LOCALSERVERPATH\GISDATA.csv"
query = f"""("{field_name}" NOT LIKE BLAHBLAHBLAH)"""
with open(CSVFile, 'w') as f:
f.write(field_name + '\n') #csv header
with arcpy.da.SearchCursor(fc, field_name, query) as rows:
for value, in rows: # Deconstruct the single-item tuple into a single variable using the for loop
f.write(value + '\n')
print("CSV File Created for GIS") This makes the intent clearer and you'll get a more obvious error if the dataset lacks a "Name" field.
... View more
06-10-2024
08:33 AM
|
1
|
0
|
2467
|
|
POST
|
My go-to is the List Subtypes function in arcpy, something like: def subtype_field(dataset):
return next(iter(arcpy.da.ListSubtypes(dataset).values()))["SubtypeField"] If the returned value is the empty string then you know there's no subtypes.
... View more
06-10-2024
08:23 AM
|
1
|
0
|
1666
|
|
POST
|
If you're on 11.3 you should be able to do anything in this help topic. 11.1 (and maybe 11.2?) has limitations with editing related data so you'll need to stick to the old viewer until your org upgrades.
... View more
06-06-2024
04:27 PM
|
0
|
0
|
804
|
|
POST
|
That actually works, if I ignore the error about having a field named "GlobalID" and make sure it binds to null then the proper value is still pulled down after opening the results. Thanks for digging that guide up for me!
... View more
06-05-2024
03:01 PM
|
0
|
1
|
1655
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-24-2023 11:47 AM | |
| 2 | 04-09-2026 11:36 AM | |
| 1 | 09-08-2023 10:07 AM | |
| 3 | 03-26-2026 08:11 AM | |
| 2 | 03-12-2026 01:41 PM |
| Online Status |
Offline
|
| Date Last Visited |
Friday
|