Hello all,
I have a question about the AckUser property in the Alarm Status Table. As far as I understand, when a user hits the Acknowledge button, the Alarm Status Table records the AckUser name either via a User Source or an Identity Provider. However, in my system, I have not used either of those methods; instead, I have used badged scanning to log the user's name directly into the database.
I created a separate alarm banner and added a short script to the Acknowledge button. The script looks like this:
system.alarm.acknowledge([self.view.params.eventId], " ", "self.session.custom.UserName")
This script grabs the AckUser from self.session.custom.UserName
.
![Screenshot 2023-08-07 163207](https://global.discourse-cdn.com/inductiveautomation/original/3X/2/f/2f08957562741427da2b9d8bae264a897531ed83.png)
Now, my question is whether there is a way to use this script on the Acknowledge button within the Alarm Status Table or if there is an alternative method to obtain the AckUser from self.session.custom.UserName
?
Any help would be appreciated. Thank you in advanced.
There is a Badge Authorization feature with the Identity Providers, could you use that?
You could also set enableAcknowledge to False on the Alarm Status component, then use the selection property and your script with a separate button component.
2 Likes
Thank you for your answer.
No, our customer doesn't want to go with that path.
I tried with your second suggestion which is creating a new acknowledge button. I used this script for the button but this acknowledges only one alarm at a time and doesn't work for multiple selection
|
loginUser = self.session.custom.UserName |
|
alarmList = |
|
selectedAlarm = self.getSibling(AlarmStatusTable).props.selection.active.data[0].eventId |
|
|
|
system.alarm.acknowledge([selectedAlarm], , loginUser) |
I'm still new with Ignition and scripting, so I'd be grateful for any guidance you could give me. Thanks.
Use the formatted code option for posts '</>'
You're close. Try this.
loginUser = self.session.custom.UserName
alarmList = []
selectedAlarms = self.getSibling(AlarmStatusTable).props.selection.active.data
for alarm in selectedAlarm:
alarmList.append(alarm.eventId)
system.alarm.acknowledge(alarmList, None, loginUser)
1 Like