I have a S123 set up with the web builder to collect points. By default, S123 creates an attachment layer to collect photos and files, but we do not need that functionality.
Here's my code snippet (note that I have already defined the max_date variable in a previous step not in this section):
feature_layer = FeatureLayer(feature_layer_url, gis=gis)
given_date = max_date
query = f"submission_date_and_time > timestamp '{given_date}'"
selected_features = feature_layer.query(where=query)
print(f"Number of features selected: {len(selected_features.features)}")
if len(selected_features.features)>0:
output_feature_class = r'C:\path\to\Default.gdb\SelectedFeatures'
copy_features = arcpy.management.CopyFeatures(selected_features, output_feature_class)
No matter what I try in line 10 - CopyFeatures, ExportFeatures, truncate an existing table and append the selected records - I cannot get those selected features out of the S123 feature layer.
I suspect that the attachments functionality is complicating the process, but I can't isolate a specific issue to troubleshoot. Does anyone have suggestions on how I can get these points exported to a FGDB?