Forum Discussion

JulieMeeker's avatar
JulieMeeker
Qrew Trainee
4 years ago

Calculate a future date in a pipeline

I am getting this error when I use the same formula that worked in a formula field 
Validation error: Invalid date/time value: 2021-07-13 00:00:00+00:00+ Days(14.0)

This is my formula {{a.complete_date}}+ Days({{b.maintenance_interval}})  complete_date is defined as a Date field type and not date/time.  

Is there a function that strips the time off because it appears that is what is causing the error?


------------------------------
Julie Meeker
------------------------------

1 Reply

  • Hello Julie,

    An easy thing to miss is that in Jinja (which Pipeline uses) when you are doing calculations like that, they should be within the same curly brackets. This is very different than how Quickbase functions work.

    For example:

    if a.value = 5
    b.value = 2

    {{a.value + b.value}} comes out to 7

    If you put in {{a.value}} + {{b.value}}  it will print the literal text of "5 + 2"

    This is why you are getting that error, instead of a time stamp, it is returning the text: "2021-07-13 00:00:00+00:00+ Days(14.0)"

    Specific to your use case, I would recommend the following:

    {{a.complete_date + time.delta(days=b.maintenance_interval)}}


    Information on how to work with dates in Pipelines can be found here: https://help.quickbase.com/pipelines/working_w_date_time.html

    I hope this helps!

    -Robert Henderson
    Support Integration Engineer for Quickbase



    ------------------------------
    Rob Henderson
    ------------------------------