Forum Academy Marketplace Showcase Pricing Features

Cant filter multiple times

Hello,
in my app I’m trying to filter a list of “Ideas” for a repeating group to the users liking.
He has the option to only show his own ideas, only ideas with a certain icon etc.

For this i created a UserIdeaFilter Thing and the following workflow everytime a user searches (eg. A checkbox is clicked, a text is entered etc):

  • Delete the current UserIdeaFilter of this user if it exists
  • Create a new UserIdeaFilter for this user
  • Add all possible ideas to that UserIdeaFilter
  • for each checkbox, input field add a filter like:
  • If checkbox “only my ideas” is checked → Search for current users UserIdeaFilter’s Ideas set list this UserIdeaFilter Ideas merged with [A List of Ideas that match the filter]
  • sort the remaining ideas by some logic
  • Update the repeating group (display list)

The issue is that the filter on its ideas does not update the list
if i try a
Ideas = [A,B,C]
Ideas = Ideas intersects [A] (which should set Ideas to [A])

Ideas is instead set to [A,B,C]
No matter the filter used, i always obtain a list of all ideas

Is this a bug or am i misunderstanding something?

Screens:

It’s a little bit difficult to understand but maybe you’re overcomplicating things.

Is Idea a data type with fields like User or Creator? If so, you could:

  1. Create a group Group filter and add states for each type of filter you want (those you want to trigger with those checkboxes or inputs)
  2. For example, the state User with type User, if the checkbox ‘only my ideas’ is clicked, set the state as the Current User
  3. Create your Repeating Group with data source Search for Ideas and add constraints for each state, for example User = Group filter's User, and check ignore empty fields.

That way you don’t have to create a workflow to update the RG data source, it’ll be always the same and it’ll update in real time when the user click on the checkboxes or fill the inputs.

But maybe I didn’t understand your question.

My previous attempt was in fact using states, however the filter can be combined (eg: only Ideas i own, with a certain icon and containing the word “great” in its title.)At this point, to my knowledge, the amount of states needed would no longer be maintainable which is why i tried to approach it with a filter that just repeatedly filters the same field, saving it back (A=filter(A)), however it simply doesnt apply the filter, maybe because source and destination are the same; that would probably be a bug, since it should not matter and works in other places. A workaround would be great, however i doubt states are of much help in this situation.

EDIT: yes Idea is a Thing with various data. I keep my data normalized so some of the filters turn out to be more complex (multiple joins)

You need only one state for each filter, how many filters do you have?

If you need to filter and combine the filtered results, just merge the results: the Repeating Group data source would be: Search of ideas (constraint User = this user):merged with Search of ideas (constraint 'has icon'):merged with etc.:unique elements

wouldnt merging two sets of ideas (eg A,B and A,B,C) produce a result of A,B,C?

And since a lot of filter combinations are possible (were talking thousands of possible mutations) which should be AND-ed together.

Am i maybe confusing merge and intersect?

list (A, B) merged with list (A, B, C) = list (A, B, C)
list (A, B) intersect with list (A, B, C) = list (A, B)

The best way to check that kind of operation is to perform it and check the results.

okay, that was my guess too. Its just weird that it doesnt perform the operation if you write to the field you read from

This is likely due to Bubble’s asynchronous nature and the execution order of actions (steps) within a workflow. They do not necessarily occur in sequence - especially when it comes to back-end operations. The manual has a good section on execution rules.