Count picklist values in child records

  • 1
  • Question
  • Updated 4 years ago
  • Answered
I'm trying to show a template/field on a parent row in a table that can show the count/roll up statuses of picklist fields in related child records. For example, I have a status picklist on a child record and I would like to be able to see how many of each status when looking at the list of parent records. It would also be great to be able to show how many child records exist for each parent. Any ideas?
Photo of Oliver Sinfield

Oliver Sinfield

  • 922 Points 500 badge 2x thumb

Posted 4 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I'll take a stab at this. If you have a master-detail reference, then you can use roll-ups to count child records. You can additionally filter the child records based on the values of the fields on the child records. If you have lookup ref fields, can you change them to master-detail?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
You will run into some limitations if you attempt to use the "child relationships" function within the model builder.  You can only include an object once, and you want to include it multiple times (once counting all records, once for each status value).

However, if you are willing to build this in a popup or a drawer,  you could use aggregate models to create the summary values, and then bring them into template fields in your drawer.  Look at the "Show Child Data in a drawer" tutorial.