best way to check for empty data?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamie
    Senior Member
    • Aug 2025
    • 215

    #1

    best way to check for empty data?

    is there a better way than this to check if there is no data in a field?

    ifThen(string\length(account.phoneNumber) > 0,
  • victor
    Active Community Member
    • Aug 2022
    • 1110

    #2
    Code:
    if (!account.phoneNumber){
        CODE
    }
    For example in Administration > Formula Sandbox you can run:

    Code:
    if (!account.phoneNumber){
        $accountPhoneNumber = 'is empty'
    }
    output\printLine($accountPhoneNumber);

    Comment

    • jamie
      Senior Member
      • Aug 2025
      • 215

      #3
      Originally posted by victor
      Code:
      if (!account.phoneNumber){
      CODE
      }
      For example in Administration > Formula Sandbox you can run:

      Code:
      if (!account.phoneNumber){
      $accountPhoneNumber = 'is empty'
      }
      output\printLine($accountPhoneNumber);
      so would i be right in thinking that this will only test true if there is something in account.phoneNumber?

      ifThen(account.phoneNumber, entity\setAttribute('phoneNumber', account.phoneNumber));

      Comment

      Working...