If you have ever wanted to add dynamic titles to your Dashboard elements, then this is the blog for you. With some out of the box thinking and some planning we can easily create some fancy dynamic titles, in a variety of styles too.
Filtered elements now have a title displaying the filtered state.
This is not a capability of the built-in title section of our elements, so we’re going to make our own faux title sections using a List element.
Set the Maximum Features Displayed to 1.
Next build out your desired title. You can use the Arcade Advanced Formatting section or just build it out in the Line Item Template. Which method you want to use depends on you and your data.
Line Item Template
Use the List the same background and text colors as the element you are adding a title to to create a title that blends into your element (Map element). Or you can use a contrasting background color to create a title that stands out (Pie Chart element).
List Color Settings
You can also use HTML to really jazz up your title.
HTML in the Line Item Template
I have designed my titles so they will display the appropriate state name as part of the title, but this only makes sense when users are actively filtering by a single state. When the state filter is not applied, my title displays the state name for the first record in my data.
Dashboard elements showing US data displays a title of New Hampshire
This is ultimately why you can’t add a dynamic field from your data into the title sections of your elements. You are trying to apply a specific field from a specific record to an element composed of multiple records with various field values. How would Dashboards know which value to display?
I don’t really care which record is being used, as they will all have the same state value when my state filter is applied. When the state filter is not applied, and there are various state values to choose from, I am not going to display any state values. Therefore, I need a default title that can be displayed when the state filter is not applied. To set up my default title, I will be using the No Selection message. I want it to look just like my dynamic title, so I will use the Source button in the Line Item Template to copy the HTML. I will do this even if I didn’t add any HTML directly to my list.
Next i will use the Source button on the No Selection box and paste in the HTML. Then, I will replace the dynamic title message with my default one.
List Line Item Template & No Selection Label
Finally, I will make sure that the No Selection vertical alignment is set to Top and my default title is done.
My list is all set up, but now I need to group it with my other element to make it look like one single element. To do this I will move my List and hold down the Shift key as I drop it into position.
Group Elements
Then I will adjust the sizing to make sure that my title has enough room to display my longest title.
Now I just need a Category Selector to power my dynamic titles. I need to mark all of my title list elements to render only when filtered to ensure that my default title displays.
Actions: Render only when filtered
Before setting up dynamic titles, you should really evaluate your dashboard and determine if it is appropriate. This only works when simple interactions are set up. If you have a lot of different filters and interactions set up, know that only one of them can control your titles. Does it make sense that your titles will change ONLY when that particular filter is used? Do dynamic titles add to your users’ understanding or does it add unnecessary complexity?
Happy Dashboarding!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.