Forum Academy Marketplace Showcase Pricing Features

Consolidate like items in a list

I have the feeling this is an easy fix but I’m having trouble cracking it.

Assume I have a list in a repeating group like this

Recipe 1
Water............20
Oil..............30
Vinegar..........05
Water............10
Oil..............35

Total...........100

Each one of these items are prepared to create a list of ingredients that adds up to 100. I would like to consolidate the like ingredients and their numbers to look like this.

Recipe 1
Water............30
Oil..............65
Vinegar..........05

Total...........100

Each ingredient is its own database entry. To build the original list I do a search for all ingredients whose recipe is recipe 1. What I’d like to do is take that list and consolidate any like entries and have their number reflect the changes from consolidation.

Is this something you’ll be doing a lot or are you just cleaning up your database? Are you on a paid plan with backend workflows enabled?

I will be doing this very often (every time the workflow populates this list)
I am on a paid plan with back end workflows

Use a :group by on search for ingredients and sum their numbers. That will give you the second list (minus the total column which you could just display since you said they add up to 100)

This is it. :group by is the tool I needed. Thank you!