Hello All,
Looking for a way to ensure an automation does not run multiple times within a set timeframe. The script is triggered by a correlation rule.
Hi Kristopher,
As mentioned by Ben this is possible by making use of memory files.
Step 1: Create memory file
First you need to create a memory file as shown below. In my case I just added one entry, but feel free to add as much entries as you need for in case you have multiple scripts in which you want to add this functionality
Step 2: Add memory file to script
Now you need to add a memory file reference to your script. Make sure that it's Persistent.
In above image I've added sample code to get and set the value in the memory file at location 0. Make sure to adapt the location in case you want to add this logic in multiple scripts and use the same memory file from step 1.
Step 3: Script execution
When executing the script you need to select the memory file that we've created in step 1.
If you use my code sample you'll see that the first time the value that you've received is empty, while the other times it contains a DateTime.
The memory files section will also show you the latest value that was assigned to the memory file.