For a tenant dashboard, we would like the alarm widget to display a device's assigned customer title as a data field.
My current workaround is to use a Cell Content Function to retrieve the customerId from the alarm object (alarm.customerId.id) and statically translate this to a title string. As far as I can tell, using the customerService to dynamically look up the customer title via the async getCustomer API call is not possible nor a good idea in a Cell Content Function.
A couple of options I have thought of without creating a custom Alarm Widget are:
Any other thoughts or suggestions would be most appreciated!
When I have a list of devices in tenant dashboard, I had same question to get their customer name.
I did the following steps and I have tested that it also works with the alarms:
Open your alarm widget, select action window (the last one) and add a action with origin "on row click"(https://thingsboard.io/docs/user-guide/ui/widget-actions/#3-on-row-click) and type "Update current dashboard state" (https://thingsboard.io/docs/user-guide/ui/widget-actions/#update-current-dashboard-state).
Back to you dashboard, open edit mode and add a alias with name "owner" (or whatever you want) and type "Owner of entity from dashboard state" (https://thingsboard.io/docs/user-guide/ui/aliases/#alias-types)
Create a new entity admin widget in your dashboard (https://thingsboard.io/docs/user-guide/ui/widget-library/#entity-admin-widgets) and select the alias that you have created before (you dont need to put any keys).
Save all, now when you click on your alarm widget's row, the entity admin widget will display your clicked alarm's customer name(since you already have the customer entity, you can also show other information of this customer).