Alarm Status: Use Full Name In User Ack Column

Perspective v8.1.13
Active Directory Hybrid w/ Internal Roles
Users are queried automatically and all user attributes are received correctly.

I would like to use a different user attribute for the User Ack column in the alarm status table. Our user names are clock numbers in AD and is what we use to authenticate/login. The alarm status table provides a column to show who acknowledged an alarm, but our clock number is displayed instead of the persons name. This makes it difficult to determine who acknowledged the alarm or added notes. I.e., “to654y3” is an example of a clock number. I would rather show the user’s first name or first and last.

I didn’t see any obvious setting and I didn’t want to try changing the pointer to the username from LDAP in case I got locked out. I also want to continue using our clock number as the login username as that is what our other systems require as well. Any ideas?
Thank you for your time.

In Designer click Perspective in the Project Browser and check what’s available in the SESSION PROPS under user. My Active Directory hybrid user source gives me,

  • id
  • userName
  • firstName
  • lastName
  • email
  • roles (an array)

If your name shows up there then you can use it in your application, session.props.user.firstName etc.

I didn’t want to try changing the pointer to the username from LDAP in case I got locked out.

I highly recommend that you use a soft failover to the default user source and leave the administrator user (or another) that can be used if the AD user source fails.
Config | Security | Users, Roles | Edit …

  • Failover Source = default.
  • Failover Mode = soft.

Session properties will only provide information on the current user. The OP wants to see the first/last name of whomever acked the alarm. I don’t know if this possible, but session props aren’t the answer.

@pturmel, that’s correct. I can get current user attributes all the live long day with email, phone number, and names.

I would just rather use the first and last name of the user who acked the alarm instead of the username.

Seems it would be an easy change?

Not to my mind. Would require changing what happens at ack time to capture more information about the user in order to display it later. Not simple. Probably worth making a feature request on ideas.inductiveautomation.com.

Thank you

I think it is possible, but it will take some work.

  1. I would create a custom property on every tag, alarm section, that describes the full name, I will call it Actor (This is the tedious part because you will have to create this for every tag with alarm). A fast way might be to export the json tags, modify it and import again.

  2. Create an script project that takes the user name as parameter (this is the none trivial part).

  3. Use a expression binding over that custom property using {ackUserName} as the parameter of runScript() calling the created script.

I didn’t use AD for this, instead pure internal user source. But, this might help anyway.

The user source

The custom property and the binding

The script I used is under that script section from image (remember to set this project name as the script project in the gateway)


I will share the script but this is based on the idea that you can access the fullname from the user source, I’ve never had the chance to test AD Hybrid.

Finally, If you hit, in the alarm table
image
you will see the Actor property under On Ack section

1 Like

@jespinmartin1, thank you for showing me this trick. I did not know that custom properties would show up in the alarm details table.

I did get this working and while not as convenient as remapping the column value, we can see the name of the user without having to go lookup cryptic clock numbers.
Thank you!
image

1 Like

Yup, just like that.
Your function should also return ‘Unknown User’ if it fails to get info of a particular username.