Alarm Count scripting

Good Morning,

How can i make my alarm count button on a popup to show the alarms of the selected system?