Often you will see choice and multi fields setup like the screenshot earlier, where the ‘values’ are purely numeric.
It’s important to note they don’t have to be!
The value and text attributes can be words or even the exact same thing. This has the benefit of making your coding so much more intuitive and naturally easier to ready.
Think about a common field like “who is advice for”, often similar fields exist and are used in wizards to determine if the document is for the Client, Partner or Both. Now in most cases this field will be set up with numbers…so you picture yourself looking at a document where the conditions are all pointing to obscure values like “1” and “3”…wtf do those mean? Now chances are you’re going to have to go check the field definitions. But, if the value had been set as “Client” instead of 1 and “Both” instead of “3” you wouldn’t have had to have checked, it would have been obvious and apparent from the get go!
So set up your fields properly as it will make them innumerably easier to read in the long run for you and other team members.”
Just because there are good use cases to use text instead of numbers doesn’t mean you don’t use both. Take premium frequency for example:
Using values that align to the raw frequency number actually makes our coding easier.
Value: 52 | Text: ‘Weekly’.
To work out the annual premium we can then just do simple things like
Matthew is an experienced and innovative Xplan consultant and developer, having worked on and developed some of the largest advice projects in the industry. Passionate about building great experiences in xplan that enable businesses and clients to get the most out of this powerful software.
Lists are one of the most versatile and powerful data types you can come across in Xplan. Harnessing them to your advantage when coding can not only make things much easier, readable but help to great cut down your code.