# V8.3.6 - acknowledge the most recent 3 alarms script

**URL:** <https://forum.inductiveautomation.com/t/v8-3-6-acknowledge-the-most-recent-3-alarms-script/115853>\
**Category:** General Discussion\
**Created:** [June 4, 2026, 9:06pm UTC](https://forum.inductiveautomation.com/t/v8-3-6-acknowledge-the-most-recent-3-alarms-script/115853 "2026-06-04T21:06:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casian](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@casian](https://forum.inductiveautomation.com/u/casian)\
**Post date:** [June 4, 2026, 9:06pm UTC](https://forum.inductiveautomation.com/t/v8-3-6-acknowledge-the-most-recent-3-alarms-script/115853/1 "2026-06-04T21:06:25Z")

</div>

I'm using this script in a button to acknowledge all alarms. What do I need to add to it so it will acknowledge only the most recent 3 alarms?

```python
    ids = [str(event.id) for event in system.alarm.queryStatus(state=["ActiveUnacked", "ClearUnacked"])]
    system.alarm.acknowledge(ids,'', "admin")

```

much appreciated

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [June 5, 2026, 6:01pm UTC](https://forum.inductiveautomation.com/t/v8-3-6-acknowledge-the-most-recent-3-alarms-script/115853/2 "2026-06-05T18:01:45Z")

</div>

You are providing a list of ids to the `acknowledge()` function, so if you only want the first 3, you need a portion, or slice, of the full list. For example

```python
myList = [0,1,2,3,4,5]
print myList[:3] # first three elements

>>> 
[0, 1, 2]

```
