skip to Main Content

XPLAN XMERGE TUTORIAL

Quick xplain: boolean fields

 October 20, 2019   |   By Matthew Townsend    |    2 minutes

Three dimensions of boolean fields

Boolean fields are generally considered to only have two states: True or False. Depending on what you are trying to achieve, taking advantage of the null (none) state can be handy.

  1. True: value = 1, text = Yes
  2. False: value = 0, text = No
  3. None: value=None, text=None

This can be good because often clients may consider data not entered to be ‘Not disclosed’ or ‘not provided’ – options which a Boolean field cannot include in its binary (Yes/No) drop down. By considering the third state of None we can get our client their not disclosed option without having to consider alternatives such as using a new field, which has implications for existing data and moves us away from using standard system fields.

Boolean xmerge coding

Historically if a Boolean field didn’t have a value assigned it would produce a blank result in your merge document so we could utilise coding like this:

Setec Astronomy

<:if str($client.valueOf(‘will_exists’)) in [‘0′,’1’]:>
<:=$client.will_exists.text:>
<:else:>
Not disclosed
<:end:>

With the above coding we will always get Yes/No/Not Disclosed (or whatever the client wants to call this).

There may be times when you want to condition off all 3 states implicitly; the classic coding for which is below:

Setec Astronomy

<:if str($client.valueOf(‘will_exists’)) in [‘0′,’1’]:>
<:if str($client.valueOf(‘will_exists’)) in [‘1’]:>
Yes
<:else:>
No
<:end:>
<:else:>
Not disclosed
<:end:>

Earlier, I said historically, that’s because these days in newer versions of Xplan Boolean fields will always return a result Yes/No/None or depending on how you’ve coded it 1,0,None. So there are no more blanks but chances are we still want to condition as ‘None’ doesn’t mean anything to a client or even staff members.

Matthew Townsend on EmailMatthew Townsend on Linkedin
Matthew Townsend
Matthew Townsend, Digital Advice Consultant
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.
Back To Top