I know many CRM developer get into Data migration or bulk update operation from CRM system to other external/CRM system.
I have gathered few useful tips while dealing with boolean fields as in how to check the value , reverse the value , use nested if with OR & AND conditions etc. I have categorised them into below and provided explanation & solution.
Check Values from Source & Set New Value
To check value of a boolean field from source do this and set other value:
IF(S1=1, 0 , 1)
(Here i am checking if S1 field value is “1” which is “TRUE” then set the new value to “0” which is “FALSE” otherwise the default will be to “1”.)
Check Combination of boolean fields and Set New Value
To check the combination of values i.e If a=1, b=0 then set some new value, Do this:
IF(AND(S1=1, S2=1), 0 , IF(AND(S1=0, S2=0),1 ))
(here i am checking if S1=1 AND S2=1 then outcome should be “0”.
please note: you can use “OR” operator as well as per your requirement.)
Check If the value is Null or Any error in retrieving the value and set default value
You might have to handle null values in the package, to do this:
(here I am checking if S1 is null or any error then i am setting the value to TRUE otherwise FALSE.)
you can also combine this with checking other values to such as if S1 =1 then 1 , S2=0 then 0 & if S2=Null then TRUE().
IF(ISERROR(S1),TRUE(),IF(OR(S1 =1 ), 0,IF(OR(S1=0),1)))
I hope this helps! I will try post help blog on other types of fields.