- Does adding new columns to a data table “contaminate” your drop down property controls?
- Would you prefer to not have to create column properties for drop-down controls in addition to the document property?
- Would you like to learn a property control hack?
Fairly early on in learning Spotfire, I took the TIBCO Advanced Configurations online training, which is where I learned how to build property controls. Now, TIBCO puts as much into their training as they can, but they can’t teach you all the tricks at once, especially when it comes to property controls. There is just too much to learn. What I am going to demonstrate in this post is a drop-down property control hack I learned from a coworker.
How Most of Us Create Drop Down Property Controls
First, let’s review how to create a drop-down property control and use it on a visualization.
- Add a text area to the page.
- Toggle the text area into Edit mode by right-clicking and selecting either Edit HTML (my preference) or Edit Text Area.
- Click the Insert property control button, and select Drop down from the list.
- In the next dialog, click New.
- Name the property control and select the data type (most likely String).
- Click OK.
- In the “Set property value through:” drop-down, select Column Selection.
- Click the Select Columns button in the bottom right.
- Click the New button to create a new column property.
- Name the property. The data type is boolean. Here is a blog post I wrote on the difference between setting the default value to true or false. I usually set to false.
- Click Ok.
- Select the columns that you would like to appear in the drop-down.
- Click Ok until out of all dialogs.
- Go to the column selector that you want to attach the property control to, such as the Color By selector. Right-click on it and choose Set from Property.
- Select the property control from the list.
BAM! Done. However, trouble arises when new columns are added to the table. They sometimes show up in your property controls. So, let me show you another way to create the drop down property control where you can rest assured new columns won’t infiltrate the property control.
Hack It Like a Pro
Follow all steps thru step 6. Then,…
- In the “Set property value through:” drop-down, select Fixed Values.
- Enter the values as you would like them to appear in the Display Name text field. Enter the EXACT column names in the Value field.
- Now pick up on step 14 above, and you have a drop-down property control whose columns won’t change no matter what happens to the data table.
I used Spotfire 7.12 to create this content.
Guest Spotfire blogger residing in Whitefish, MT. Working for SM Energy’s Advanced Analytics and Emerging Technology team!