Behaviour of formula string\split

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • esendino
    Senior Member
    • May 2019
    • 163

    #1

    Behaviour of formula string\split

    Hi

    I was using this expression

    $array = string\split($txtfield,',');

    It split text by the comma as expected and provide as many items of the array as expected.

    If the field $txtfield has some text without any comma gives an one single item array. Perfect.

    But if $txtfield is null I would expect it provides an empty array with no item

    Instead of that I receive an array with one item. And that item is null

    Seems to me that this behaviour is not correct.
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9640

    #2
    Not sure. I'd rather throw an error. It treats null as ''. I'm ok with it.

    Comment

    • yuri
      EspoCRM product developer
      • Mar 2014
      • 9640

      #3
      It's the same behavior as PHP has. It will throw error in the future.

      Comment

      Working...