I want to make a dropdown that filters companies by age (e.g. under a year, from 1-5 years, etc.) but the age of the companies is specified for example 2023 or 2024, etc. How can this be done?

If all you have is the year the company started, then unless I am missing something, you will need to use an advanced filter. I could see a path to adding an age field to the Company data type and updating that field for every company every year, but that juice might not be worth the squeeze just to avoid the advanced filter. If you don’t know much about advanced filters, be aware that the filter is applied on the client side. So, all of the results of the search will be returned to the browser, and then the filter will be applied, and that might not be the most efficient way to go from a performance and/or workload unit perspective.

The above being said, I started with an option set that defines the options for the company age dropdown.

As you can see, the option set has two attributes (range min and range max), and they are set for each option as follows:

  • Under a year (0,0)
  • 1 - 5 (1,5)
  • 6 - 10 (6,10)
  • 11 - 20 (11,20)
  • 21+ (21, 100)

With the option set and corresponding dropdown in place, here is the advanced filter on the repeating group’s search for companies.

Note that because ignore empty constraints does not work with advanced filters, there is a conditional on the repeating group that says when the company age dropdown is empty, do a search for companies with no constraints.

Hope this helps.

Best…
Mike

P.S. Just FYI… it is bad form to post a duplicate topic when you don’t get the answer you want in an initial post. It’s called cross-posting, and it makes the forum quite messy.

P.P.S. While I don’t mind that you reached out to me via DM to help you, I would be careful about doing that in general. When I was moderating, I used to get complaints from folks who thought that was an abuse of the DM feature. Again, just FYI.

2 Likes