Select to view content in your preferred language

automatic deletion of items when the date passed

613
3
07-19-2023 07:14 AM
Rémi
by
Occasional Contributor

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 | Esri Principal Product Engineer | Cloud & Database Administrator | OCP - Oracle Certified Professional | "In 1992, I embarked on my journey with Esri Technology, and since 1997, I have been working with ArcSDE Geodatabases, right from its initial release. Over the past 32 years, my passion for GIS has only grown stronger." | “ I do not fear computers. I fear the lack of them." Isaac Isimov |
berniejconnors
Frequent 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