# Filtering a select control

**URL:** <https://connect.superhuman.com/t/filtering-a-select-control/37073>\
**Category:** Ask the Community\
**Created:** [January 29, 2023, 6:53pm UTC](https://connect.superhuman.com/t/filtering-a-select-control/37073 "2023-01-29T18:53:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeb\_Dasteel](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/jeb_dasteel/32/29456_2.png) [@Jeb\_Dasteel](https://connect.superhuman.com/u/Jeb_Dasteel)\
**Post date:** [January 29, 2023, 6:53pm UTC](https://connect.superhuman.com/t/filtering-a-select-control/37073/1 "2023-01-29T18:53:56Z")

</div>

Hello there. Here’s the formula I am using to create a select control which is a list of companies filtered for just the company projects that have a checkmark in an “Initiate Invoce” column:

Projects.Company.Filter(Projects.[Initiate Invoice]=true).reverseList()

The idea is to use the checkmarks to identify which projects I want to crank out an invoice for (because there are unpaid hours over a certain amount). I simply check that box in the projects table and then go over to an invoice generator and apply the select control to winnow down all customers to just the ones that have a project with a check.

It seems to actually produce the right result BUT I get an error nonetheless. See attached screenshot.

Any advice?

Thanks very much.

![image](https://global.discourse-cdn.com/coda1/original/3X/0/4/042764da9e73369377fb68de271337adfcc68d8b.png)

---

<div class="post-metadata">

**Author:** ![Jeb\_Dasteel](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/jeb_dasteel/32/29456_2.png) [@Jeb\_Dasteel](https://connect.superhuman.com/u/Jeb_Dasteel)\
**Post date:** [January 29, 2023, 6:55pm UTC](https://connect.superhuman.com/t/filtering-a-select-control/37073/2 "2023-01-29T18:55:53Z")

</div>

Well, I was wrong. It coincidentally produced the right answer at first, but fails in subsequent testing…

---

<div class="post-metadata">

**Author:** ![Thierryvm](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/thierryvm/32/25803_2.png) [@Thierryvm](https://connect.superhuman.com/u/Thierryvm)\
**Post date:** [January 29, 2023, 8:05pm UTC](https://connect.superhuman.com/t/filtering-a-select-control/37073/3 "2023-01-29T20:05:58Z")

</div>

Hi @Jeb_Dasteel,

I saw that you have a little problem with your filtering formula. Don’t worry, I’m here to help!

It looks like you’re trying to filter the projects to show only those that have “Initiate Invoice” set to “true”, and then sorting them in reverse order.

The formula you used is almost correct, but there are some syntax errors. Here is the correct formula:

`filter(sort(filter(Projects, Projects.[Initiate Invoice] = true), Projects.[Company], descending), Projects.[Company], descending)`

What happens here is that we use the **“filter”** function to select only those projects that have **“Initiate Invoice”** set to **“true”**. Then we use the **“sort”** function to sort these projects by company name in descending order. And finally, we use the “filter” function again to select only those projects that have **“Company”** set.

I hope this helps you solve your problem! If you have any other questions, please let me know.

Have fun with Coda!

Sincerely,

@codafrench - Thierryvm

---

<div class="post-metadata">

**Author:** ![Jeb\_Dasteel](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/jeb_dasteel/32/29456_2.png) [@Jeb\_Dasteel](https://connect.superhuman.com/u/Jeb_Dasteel)\
**Post date:** [January 29, 2023, 10:36pm UTC](https://connect.superhuman.com/t/filtering-a-select-control/37073/4 "2023-01-29T22:36:57Z")

</div>

Hi Thierry. Thanks so much! I still can’t get this to work though.

To keep it a little simpler, let’s ignore the sorts completely. I can add that back in later.

Don’t I need to start with the list I want to use in the control as selectors? That would be Projects.[Company]

That would be, in my Company Selector control:

So it would look like: Projects.Company.Filter(Projects.[Initiate Invoice]=true)

But this doesn’t work either. I feel like I’m missing something really obvious. The dot operators get a little confusing to me, so I may be misusing them here.

Thank you.

Jeb

---

<div class="post-metadata">

**Author:** ![Jeb\_Dasteel](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/jeb_dasteel/32/29456_2.png) [@Jeb\_Dasteel](https://connect.superhuman.com/u/Jeb_Dasteel)\
**Post date:** [January 30, 2023, 12:54am UTC](https://connect.superhuman.com/t/filtering-a-select-control/37073/5 "2023-01-30T00:54:38Z")

</div>

Thierry, I think I just figured it out. The following seems to work, and it’s really simple:

Projects.Filter([Initiate Invoice]=true).Company

---

<div class="post-metadata">

**Author:** ![Thierryvm](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/thierryvm/32/25803_2.png) [@Thierryvm](https://connect.superhuman.com/u/Thierryvm)\
**Post date:** [January 30, 2023, 2:10pm UTC](https://connect.superhuman.com/t/filtering-a-select-control/37073/6 "2023-01-30T14:10:44Z")

</div>

So your problem is solved? Please share your progress with the community, as it will help others 🙂

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/system/32/24484_2.png) [@system](https://connect.superhuman.com/u/system)\
**Post date:** [April 30, 2023, 2:11pm UTC](https://connect.superhuman.com/t/filtering-a-select-control/37073/7 "2023-04-30T14:11:31Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
