ADF - How to validate String is of valid DATE format?

Leau Bee Lin 91 Reputation points
2022-01-19T03:47:29.027+00:00

ADF - How to validate String is of valid DATE format?
Tried with Set Variables - formatdatetime. However, this will throw error when String is of invalid DATE format, any way to 'ignore' error so that pipeline will not appear as failed?

Or got other way of validating the string

Thanks.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,640 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Nandan Hegde 29,896 Reputation points MVP
    2022-01-19T07:45:34.597+00:00

    Hey,
    You can use assert transformation property of dataflow for validations :
    https://youtu.be/_NzWpTRxt0s

    Or you can refer the below link end phase where in you can fail an activity in adf but with a successful pipeline run status:

    https://datasharkx.wordpress.com/2021/08/19/error-logging-and-the-art-of-avoiding-redundant-activities-in-azure-data-factory

    0 comments No comments

  2. KranthiPakala-MSFT 46,422 Reputation points Microsoft Employee
    2022-02-01T01:06:03.65+00:00

    Hello @Leau Bee Lin ,

    My understanding is that you would want to validate if a given string is of valid date format and then continue the flow of you pipeline execution. And for this you have tried validating it using a set variable activity but when it fails the activity fails and hence the pipeline. So you are looking for other alternate solution to continue executing the flow even though the validation fails. Please correct if my understanding is wrong.

    In addition to @Nandan Hegde 's inputs you could also use an IF Condition activity and in the condition, you can use the same dynamic expression that you have used in your set variable activity and if condition is met you can have the pipeline flow is the true path and if the condition is not met you can continue the pipeline execution flow in the false path

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators