Failed to map '21.value': Function 'if' finished with error!

image

Hi,

I’m getting the following error in the Set multiple variable module:

“The operation failed with an error. Failed to map ‘21.value’: Function ‘if’ finished with error! Function ‘toString’ finished with error! Function ‘formatDate’ finished with error! Function ‘parseDate’ finished with error! ‘’ is not a valid date or does not match the date format.”

The error seems to stem from this function:
image

But only when the formField is empty:

When the formField is populated

if( formField == null; null; formatDate( parseDate( formField; YYYY-MM-DD ); DD-MM-YYYY ) )

I have tried to change the formula in the following ways, without solving the issue:

  1. Changing “null” to “emptystring”
  2. Trying to use ifempty like this:
if( ifempty( formField; true ); null; formatDate( parseDate( formField; YYYY-MM-DD ); DD-MM-YYYY ) )

Not sure why the function fails. Anyone have any idea?

Instead of variable = emptystring use

length(variable) = 0

2 Likes

Thanks,

I was able to fix it by changing the formul to this:
image

And in a new set variable module after it where I used this:
image

But your solution is much better, will try that as well! Thanks!

1 Like

Got it tested and it works smoothly!

Thanks man!

2 Likes