Forum Discussion
I imported your pipelines. They work as expected. The error is being transformed by the Mapper in the error pipeline: the entire response is under “path”.
Thank you @Spiro_Taleski. That would work, but I also need to run the Data Validator snap on other fields as well.
I have managed to work around the issue for now by using a Conditional snap before the Data Validator that checks for null values in the $DOB field and transforms them to an empty string ‘’. Then use the this regex that matches either an empty string or the date: ^$|\d{1,2}/\d{1,2}/\d{4}$
While the Conditional snap may work in this case, I would also recommend looking at the Mapper snap with the following $.get expression as an alternative for the same:
(Note: Pass through is checked so that the only fields you need to concern with are those you need to run through the validator as a string.)
I don’t know that it’s a huge benefit, but it seems cleaner/easier to me and it allows for additional transformations/mappings on other fields in the same snap.
Helpful tip: In this forum, you can use the
icon to encapsulate code to preserve formatting
^$|\d{1,2}/\d{1,2}/\d{4}$
Related Content
- 2 years ago
- 3 years ago
- 5 years ago