- Do you find dealing with long Spotfire ids in text areas annoying?
- Would you like an easier way to reference and work with them?
- Have you ever tried creating aliases?
You might be asking, what is an alias? Well, an alias is simply another name or reference for something within the code. In this case, we want to create an alias for the Spotfire ids that the software. The assigned ids are long and can be difficult to work with, so we create aliases for ease of use. Ruths.ai recently published two templates that demonstrate the use of aliases. You can download them from the links below.
Using Aliases — HTML Example
In the example shown below, a jQuery script passes a calculated value to a property control. The id attribute creates the alias for the Spotfire id within the span tag. Then, jQuery script calls or references the aliases. This is much easier than copying and pasting the Spotfire ids.
If you are new to working with the HTML editor in Spotfire, you might not know that you can click on the text area element on the right in the list, and it will highlight where that control is at in the text area HTML. Also, you can double-click on the id, and Spotfire will highlight the entire id so it can be copied and pasted.