Easy Tricks for Better Models
TODO
Dropdowns - Reliability & Usability
- Show all different types of choices and when they're applicable
Choice Dropdowns
One of the biggest missed opportunities we see at Lumina when reviewing customer & client models is the infrequent use of the Choice() and MultiChoice() functions. Making use of these will not only make your model more clear from a client perspective, but will also make your model more flexible should something like an index change in the future.
To demonstrate this you can view the video below or read on: VIDEO EMBED HERE
Choices as Labels
When trying to make our model more flexible we should think of using Choice() as a "label". A label as we describe it is a node that uses Choice() to reference a value from an index. The value of this should become more apparent from the following example.
Scenario
I've created a model that references values in my index called "Fruits". However, I notice midway through development that I've actually made a typo in my index:
If I fix the typo in my index then everywhere else I reference it in the model will break. This headache could've been easily avoided by making use of labels. Here's how that could look:
Labels take care of issues like typos because they all references point to a single label node that grabs its value based on the position in an index.
To use labels, find the parts of the model that reference an element from the index and then instead of typing something like
[Fruits = 'Apples']
you would type
[Fruits = Apples_Label]
Another reason this is to help track where specific elements of an index are being used. If there was a different reason why I wanted to find every place 'Apples' was used in my model, I could look at the object window for Apples_Label and view the list of Outputs:
Enable comment auto-refresher