Skip to main content
Question

Pipeline code using 'or' and 'and'

  • February 7, 2023
  • 0 replies
  • 168 views

Forum|alt.badge.img+6
We need to populate a 'month' field if family member 1 or family member 2 has a birthday that month. Each month has its own field. In this example, I am using the MAY TOUCH field. So, if (family member 1 or family member 2 has a May birthday) and MAY TOUCH is blank, add the value 'Birthday Month' to MAY TOUCH. However, I get the red box around that field which means something isn't right. I have scoured this forum and can't seem to figure out what part of the code is wrong. I have tried many different words like isNull, ="", and using quotes around "Birthday Month", etc, but none of those work. Here is my code:

{% if (a.account_number_family_1_birth_month_3_charac is May or a.account_number_family_2_birth_month_3_charac is May) and a.may_touch is not defined %}
Birthday Month
{% endif %}

The second part of this will be....if MAY TOUCH is defined, then MAY TOUCH value will have 'Birthday Month' appended to the text already in the field.

Step A in the Pipeline is Search Records where account_number_family_1_birth_month_3_charac does not equal 'blank' or account_number_family_2_birth_month_3_charac does not equal 'blank',
step B is Update Record

------------------------------
Amy Gosz
------------------------------
This topic has been closed for replies.

Forum|alt.badge.img+15
  • Quickbase Alumni
  • February 7, 2023
Amy,

I am not a Jinja guru.  @Prashant Maheshwari  @Doug Henning are the kings of this.   However I think your expression has the wrong operator and the text value needs quotes.

​a.account_number_family_1_birth_month_3_charac == 'May'

​

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

Forum|alt.badge.img+11

  • Are we implying there are 12 fields for each month Jan /Feb / March and whenever a family member has a birthday , that particular field will get updated each month ? 
  • All items are stored as text ? Can you give example of one field to gauge ? 
  • I keep thinking why won't a QuickBase formula achieve this?
I did a simple test with 

(text)Name - Prashant
(date)DOB - 29/05/1985
(text)Month

pipeline Jinja
{{(a.dob|timezone('Asia/Calcutta')).strftime('%b')}}

The advantage of above method is simply referencing the date field and month will be found. Once we are clear with the structure , we could play around



------------------------------
Prashant Maheshwari
------------------------------