Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Create a error message if there is date with different format

BautistaC888
8 - Asteroid

Hello,
I need to add an error message to the workflow if the date format is different from "dd/mm/yyyy" (like the first row).
date fields.PNG
Is there a way to check for multiple columns?
Please let me know.
Thank you.

3 REPLIES 3
CoG
14 - Magnetar

You can set up a separate branch from your main data stream, Transpose the data, check the date format, and join back to original data prior to Message Tool to check and throw the error. It is more difficult/impossible to detect "mm/dd/yyyy" as the incorrect format. My hope is that you do not need to evaluate this.

 

Here is a sample workflow:

Screenshot.png

Hope this helps and Happy Solving!

MelGibson
10 - Fireball

This is the way that I would do it. 

Put this formula in a multifield tool selecting the date fields you want

IF REGEX_Match(tostring([_CurrentField_]), "^\d{2}/\d{2}/\d{4}$") THEN "Valid" ELSE "Invalid" ENDIF

Then add a transpose tool -  Data Columns would be the new columns created from the multifield tool

Filter tool for Invalid

Add a test tool (Expression true for first record) and test value would be [Value]='Valid'

You will get an error message. You can stop the workflow based on receiving an error in the workflow configuration window - runtime 

flying008
15 - Aurora

Hi, @BautistaC888 

 

FYI.

录制_2024_11_12_08_54_24_649.gif

 

Labels
Top Solution Authors