Select to view content in your preferred language

automatic deletion of items when the date passed

449
3
07-19-2023 07:14 AM
Rémi
by
New Contributor II

Hello,

I have a layer with an "end date" attribute and i would like to automate the deletion of an element when the end date entered has passed. This layer is stored in a postgres database.

Do you have any idea how to proceed ?

Thanks,

0 Kudos
3 Replies
MarceloMarques
Esri Regular Contributor

Create a python arcpy script or an arctoolbox model builder, then schedule the script to run on the date and time that you need. Schedule geoprocessing tools—ArcGIS Pro | Documentation

| Marcelo Marques | Principal Product Engineer | Esri |
| Cloud & Database Administrator | OCP - Oracle Certified Professional |
I work with Enterprise Geodatabases since 1997.
“ I do not fear computers. I fear the lack of them." Isaac Isimov
berniejconnors
Regular Contributor

Rémi,

        This sounds like a job for a Notebook with a scheduled "task".  Once you create the python code for the deletion of the layer create a "Task" that will trigger only once to run your script on a specific date.

https://doc.arcgis.com/en/arcgis-online/create-maps/prepare-a-notebook-for-automated-execution.htm

Bernie.

0 Kudos
MiguelParedes
Esri Contributor

Greetings @Rémi 

What you would probably want to use in your Python script would be the command DeleteFeatures, based on an expression that evaluates the "end date" attribute.  You would then use any of the methods suggested by @marceloRod  and @berniejconnors  to schedule the execution of the script.

Miguel
0 Kudos