Skip to main content
Question

Pipeline error when date field is empty and using {{datefield|date_dmy}} to format date

  • February 4, 2022
  • 0 replies
  • 85 views

Forum|alt.badge.img+7
I have a pipeline that takes several date fields and writes them out to text fields in another table, with {{datefield|date_dmy}} used to format the date. It works when all the date fields contain a date, but fails when any of the fields are empty, producing an error 'Validation error: Incorrect template'. 

Has anyone else had the same issue and/or know how to workaround this without adding in conditions to check for fields being blank (as this isn't a feasible solution) or creating formula fields in the table to format the dates as strings? 

Thanks.

------------------------------
Jeremy Anson
------------------------------
This topic has been closed for replies.

QuickBaseJunkie
Forum|alt.badge.img+15
Something like this should do the trick

{{'' if a.datefield is none eles a.datefield|date_dmy}}
 
If you're interested in learning more about Jinja check out this Intro to Jinja for Pipelines course.


------------------------------
Quick Base Junkie
------------------------------