I’m working with a flow where I need to convert the following string data_arrivo in the following format
but, the system crash when find the NULL fields (and option is to replace NULL into today date)
how can I fix this?
thanks to all
Hi @Pasquale_p , as your data appears to contain the string “NULL” rather than an actual null (missing) value, one option is to first convert these into actually missing values using Rule Engine, and then you can use String to Date&Time after that
The following Rule Engine rule will do as you require.
Normally, the final line of the Rule Engine would be a “catch-all”
TRUE => something but by leaving that off, it will result in the default being the creation of a missing value. In this case, any line that doesn’t contain the string “NULL” will be reproduced as-is, meaning that any line that does contain “NULL” will become missing
After that a Date&Time to string node can perform the required conversion.
Here is a demo workflow
Convert DateTime with Null in String.knwf (9.5 KB)
@takbb you were faster at replying lol
@Pasquale_p here a complementary and different solution to the one posted by @takbb:
20230501 Pikairos Replace Null Value by Todays Date.knwf (39.1 KB)
Hope it helps
Lol @aworker… I was maybe faster but less complete!
I realised after posting that I hadn’t added how to put in today’s date, so I was about to correct my mistake but you have beaten me to that!
I will learn how do you built!
I’ve many questions to submit
That’s a nice trick @takbb ! I usually use the Rule Engine’s TRUE => “”, then use the AutoCast to convert empty strings to missing values… didn’t realize that leaving it to default would save me the double trouble.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.