Forum Discussion

tarena's avatar
tarena
New Contributor III
9 months ago
Solved

mapValues returns null when adding certain condition

I'm using the following expression to parse date fields in an object. It works correctly. However, when I replace key.contains('date') with another string to compare, the expression returns null for ...
  • tarena's avatar
    tarena
    8 months ago

    Thank you. This was pretty close to the problem. If there is an error in a function called in mapValues, a null object is returned as the result of map values. My original error was from adding an or condition that would include keys which couldn't be parsed as dates. This error turned the entire object to null, which was what I observed.