LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  How to replace a NULL or Empty fileds with a '0'?

    Employee
    Posted 05-11-2011 06:44

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Papazol

    I try to replace the empty fields with a '0'. I use 'Replace text' node for that. But It doesn't succeed. Data are doesn't changed at all.
    I doesn't know how I define an empty string in the replace script:
    Calling_number20::
    `""->0` or `null->0`

    PLZ HELP


  • 2.  RE: How to replace a NULL or Empty fileds with a '0'?

    Employee
    Posted 05-11-2011 07:47

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    Hey,

    I could be wrong on this but I'm pretty certain the replace text node is just doing a textual substitution, so for NULL values, or values with no text, then there is nothing to replace.

    In any case, I would recommend that you just do this using a filter node.
    It seems like that would be a much better option.

    With the brainscript something like:

    newCallingNumber = 'Calling_number20'
    if newCallingNumber.isNull() or newCallingNumber.equals("") then {
     newCallingNumber = "0"
    }
    
    emit *
    override emit newCallingNumber as "Calling_number_20"
    Bear in mind, I haven't tested that code, so it might be a little off.


  • 3.  RE: How to replace a NULL or Empty fileds with a '0'?

    Employee
    Posted 05-12-2011 01:08

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Papazol

    Thank you Tim for your suggestion.
    I have solved it with a filter, on almost the same way you have suggested. But I didn't know the Replace node is only for existing text, and tought it will be an appropriate manner to handle those fields with the 'Replace Text' node.

    One more time, thank you for your advice.