Get the count of listed items in a filtered list

Hi everyone,

I would much appreciate your insights here.

Scenario:

  • You have a list (100 items in the list for example)
  • You have a field to search within the list
  • The user inputs a keyword in the search field and now the list shows 10 items matching the keyword entered

How can I get that value (10)?

I need to create conditional visibility based on the number of items presented in a list once it’s filtered by the user searching.

The conditional would look something like this (an example):
Show only if the number of results in the list is bigger than 10.

Is there a way? a workaround?

Thank you :pray:

Hi @charleshope :wave:

Like this?

Thank you

Exactly!

Learned a few things there. Thank you!

1 Like

Great and Your Welcome :+1:

@dilon_perera

Actually, it’s not quite working, because the result of the search is a bit more complex.

The search depends on a dropdown + a search field. This is actually something you helped me with here: Dropdown + search input to filter list (many-to-many collections) - #4 by dilon_perera.

So, considering the conditions there, how can we achieve when I’m trying to do now?

I can’t find a way. I’ve tried, in different ways, and I can’t find a way. I’m always missing something.

Thanks.

2 Likes

Like this?

Thank you

@dilon_perera

That’s much closer, but not quite there.

You see, when the dropdown is empty, and the input field is empty, your calculation is returning 0 results. However, that’s not the reality. With no selection in the dropdown, and no inputs in the search field, the list is showing everything, so there are results presented.

Thank you.

1 Like

You mean when there no results then show all items of that category and 0 results?

If you look at the app you shared, change the visibility of the field “0 Resuls” to always be visible.

Run the app and don’t select anything from the dropdown, and don’t input anything in the search field.

You will see the full list of items, but the “0 Results” is still showing “0 Results”, when right under it there’s a full list of items, so that number should be the total number of items in that list.

I hope I’m explaining myself. :slightly_smiling_face: Let me know. Thanks.

1 Like

Like this?

Yeap. Like that :slightly_smiling_face:

So if there’s no selection on the dropdown, and no input on the search field, we see the total number of items presented.

1 Like

You can refresh the app and see. I have added

You can add a text property and add all items count and type results and change the visibility visible if selected category is equal to empty. And make it a group and set the visibility condition to the group visible if the input is equal to empty. Then the two conditions are matching that text is appearing. So when the dropdown and input is empty that one is appearing

@dilon_perera

Looks like that’s the solution. Thanks.

1 Like

Your welcome :+1:

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