Skip to main content
Solved

Strings and Integers in a Pipeline Date Calculations

  • January 6, 2023
  • 0 replies
  • 124 views

Forum|alt.badge.img+15
I am trying to formulaically change a date with a Pipeline

If I hard code the change in the date it will work with the following expression

{{a.date +time.delta(days=2)}}

However if I use a variable 

{{a.date +time.delta(days='a.numeric_field')}}

I get the error

Validation error: Incorrect template "{{a.date +time.delta(days='a.numeric_field')}}". TypeError: cannot concatenate 'str' and 'int' objects 

The field a.date is the string and a.numeric_field is my integer

I have tried all sort of variations to convert the data type such as 
'a.numeric_field|str'
Str(a.numeric_field)

However my syntax is aways wrong.

Any suggestions would be greatly appreciated.

------------------------------
Don Larson
------------------------------

Best answer by DougHenning1

Hi Don, you need to specify the field without the quotes:

{{a.date +time.delta(days=a.numeric_field)}}

If a.date is a string and not a date, then you need to parse it:

{{time.parse(a.date) +time.delta(days=a.numeric_field)}}

Hope that helps!

------------------------------
Doug Henning
------------------------------

Forum|alt.badge.img+6
  • Quickbase Staff
  • Answer
  • January 6, 2023
Hi Don, you need to specify the field without the quotes:

{{a.date +time.delta(days=a.numeric_field)}}

If a.date is a string and not a date, then you need to parse it:

{{time.parse(a.date) +time.delta(days=a.numeric_field)}}

Hope that helps!

------------------------------
Doug Henning
------------------------------