RyanPeart
4 years agoQrew Trainee
Pipelines - Get Length of List of Pipeline Rows
Hello,
I am trying to schedule a weekly calculation every Friday using Pipelines. The calculation process is as follows:
I was able to successfully return a filtered list of Pipeline Rows that match the conditions. But when I try to perform step #6 and update the records with {{length(d.record_id) / 20}}, I get this error: Validation error: Incorrect template "{{length(d.record_id) / 20}}". UndefinedError: 'length' is undefined.
Is there a different way I should be trying to get the number of filtered Pipeline Rows out of the 20 selected that match the conditions in order to use it in my calculation?
------------------------------
Ryan Peart
Database Analyst
Minerva Knowledge Management
------------------------------
I am trying to schedule a weekly calculation every Friday using Pipelines. The calculation process is as follows:
- Select the 20 most recent records from a QuickBase App table, sorted by a date lookup field (I also can't get this to work, but I will make another post about this issue).
- Define a Pipeline Rows table using the Bucket channel.
- For each of the 20 QB App table rows, store them all in the Pipeline Rows table.
- Search the 20 Pipeline Rows table to return a filtered list of Pipeline Rows whose fields match certain conditions.
- Search the QB App table again for all records created over the past week.
- For each of those QB App table records created over the week, update a field with: (# of Pipeline Rows matching the conditions / 20).
I was able to successfully return a filtered list of Pipeline Rows that match the conditions. But when I try to perform step #6 and update the records with {{length(d.record_id) / 20}}, I get this error: Validation error: Incorrect template "{{length(d.record_id) / 20}}". UndefinedError: 'length' is undefined.
Is there a different way I should be trying to get the number of filtered Pipeline Rows out of the 20 selected that match the conditions in order to use it in my calculation?
------------------------------
Ryan Peart
Database Analyst
Minerva Knowledge Management
------------------------------
- I think the Jinja you're looking for is {{ (d | count)/20 }}.
This would return the count of records found in step D then divide by 20.
If you're interested in learning more about Jinja I suggest checking out my blog post "What is Jinja" and my course "Intro to Jinja for Pipelines"
------------------------------
Sharon Faust (QuickBaseJunkie.com)
Founder, Quick Base Junkie
https://quickbasejunkie.com
------------------------------