Help with advanced filter in pipeline
Hi folks. I am trying to get an advanced filter to work in a pipeline so that I don't have to enter all 81 combinations in.
I don't speak Jinja (yet), so I used AI to help me code this. It looks good to me, but when we ran a test, the pipeline did not trigger. I assume it has to do with the way which the Jinja is written. Can anyone help me understand what I did wrong, here?
Here is the offending code. It's also been tried without the various cleanup filters on the fields (trim, float, string).
All string values for these fields come from pre-defined lists, and the two hours fields are numerics. I think the problem has to be either the syntax or references; I don't think the actual logic is bad.
{{
(a.Req_Status|string|trim) == 'Submitted'
and (a.Requested_Hours|float) < (a.Provider_Expected_Hours|float)
and (a.Approv_Mgr1_Response|string|trim) in ['Approved', 'Not Available', 'Not Required']
and (a.Approv_Mgr2_Response|string|trim) in ['Approved', 'Not Available', 'Not Required']
and (a.Approv_Dir1_Response|string|trim) in ['Approved', 'Not Available', 'Not Required']
and (a.Approv_Dir2_Response|string|trim) in ['Approved', 'Not Available', 'Not Required']
and (a.Approv_Oversight_Response|string|trim) == 'Pending'
}}
Thanks for your help!