Choice component + filter = strange behavior

Hello,

I have a problem that looks like a bug with the “choice” component and the “filters”.

My use case is simple: I have a child profile table “Kids” and a table “catalog” of illustrated cards. I what to associate some cards to children profiles as rewards. The “choice” component allows me to enter the row id of a child profile in a column of the table “catalog”. There is a relationship column in the child table that checks if its name is associated with a card, this allows the displayed cards that the child collects to be shown in its own screen and it works well.

However, when I want to add filters to the “choice” component, ie a “number of gold pieces greater than or equal to 20” and “collection column” in the child table does not contain the name of the card", the behavior changes: each choice becomes unique and erases the previous one, even if “allow selecting multiple” is selected."

I really do not understand why filters would be wrong, but even, they seems to change the way the choice is made, from “multiple” to “only one”?

Hi @Bruno_Chazel

The “choice” component allows me to enter the row id of a child profile in a column of the table “catalog”.

Does a card can be associated to multiples kids?
What it the type of the columns you use for the filters? Especially the collection columns? If it’s only text (“card1,card2”) you have to split it and use this split columns. I think it would work if the issue comes from this of course.

Can you include some screenshots of how you’re setting the filter up, and sample data on the backend? Thank you.

Many thanks,

Here is a screenshot of the card table :

The choice component writes into the “quel enfant row ID” which is a text column.

Below the child profiles table :

The relation colunm is linked to “compile propriétaire” that separates the “quel enfant row ID” into independent elements.

and the filters :

image

When I add the second filter to hide child that already own the card … it doesn’t work anymore.

@Lucas_Malguy1 : yes, 1 card can have multiple kids owners.

Yes, I can see why. It’s because the column you are trying to filter on is a Lookup that’s returning an array. “Does not contain” only works with strings, not arrays. What you could do is add a Joined List column that targets your Lookup column, and then use that Joined List column in your filter condition.

Many thanks for the reply,

The join list into the cards table looks like this : (so it doesn’t work :frowning: )… ?)

I tried this filter :

that (I understand ?) means : there isn’t the name of the card into the join list column into the child table.q

not working.

I tried the same filter using the text column where choice writes : “quel enfant row id…” : not working

I wanted to try same filter using a split column of 'quel enfant row id", but It doesn’t appear as a selection :

I tried this one :

not working.

I have no more ideas … :thinking:

If you’re wanting to filter by name, you should have a joined list of Names rather than RowIDs.

Thanks @Darren_Murphy

I am obviously missing something.

I created a simpler version of my use case.

I want to filter the names displayed by the choice component based on the the fact that they -are/are not- already owners of this specific thing.

Couldn’t make it worked, argh it is probably so simple :sob: :laughing: !

So you only want to show names that are not already associated with the Thing in question?
If so, the filter on your choice component should be “relation to things is empty”.

In my understanding it doesn’t do what I want : “relation to things” will not be empty as soon as a child got 1 thing, whatever it is :

I want to hide the child because he already owns this specific thing, as he will have already collected other things.

In this example, once user click on the “Rombi” item, the choice component should only show “Julien” because “Paul” and “Marie” own already “Rombi”. It seems easy, but couldn’t find the filter that do the trick !

Yes, sorry - you’re correct.

Let’s just take a step back. Tell me, are you trying to do something like the following?

1 Like

What if you try something like that:



Uploading: Capture d’écran 2023-04-11 à 15.51.16.png…

I didn’t catch the user experience so maybe it won’t fit your needs, but let us know.
Anyway, I think you would need to add other columns to deal with the ownership thing.

EDIT: I see than @Darren_Murphy was faster!

@Darren_Murphy

Yes, I am trying to do something similar, but the user ID is the same : user is one parent that may have multiple children. And I want that these children can collect some illustrated cards.

The way I found was this screen with a choice component that write the name (or row id) of the child into the table of cards, so child can have their own separate collection. (I wanted to do that directly from each child 's screen, where a child could just touch a button like “buy this card” to collect the item, but I didn’t success to find a proper for now).

@Lucas_Malguy1
I tried that but it doesn’t work :sleepy:

This is weird :thinking:

Let’s recap to see if didn’t miss something.

  • On the app, a user is on the cards list, open one and is directed into the card’s details page.
  • When he clicks on a name (to make it owner) the selected name is added into the card’s owner on the cards table.
  • In the User tab, there is a relation between the User name AND the card owner’s name in the cards tab (split owner’s name)
  • You then retrieve the names of the name with a lookup in the owned card.

Is that right? :eyes:
Your choice component has as a data source the users tab right?

If yes my example should work since it’s this exact workflow (or i’m going crazy)
If not I’ll do a screen recording :wink:

  • On the app, a user is on the cards list, open one and is directed into the card’s details page

  • When he clicks on a name (to make it owner) the selected name is added into the card’s owner on the cards table.

Yes. In my simple use case, user is on the “things” list, touch 1 item, that open the page (slide in) with the choice component. the choice component shows the child and write the chosen name into the column “choice component” of the things table. (and it works, but without using the filter).

  • In the User tab, there is a relation between the User name AND the card owner’s name in the cards tab (split owner’s name)
  • You then retrieve the names of the name with a lookup in the owned card.
    Is that right? :eyes:
    Your choice component has as a data source the users tab right?
    If yes my example should work since it’s this exact workflow (or i’m going crazy)

It is not into the user tab, it is into another table “children” :

I’ve made also made several columns into the “things” table to get the information owner/owned in both table, hoping I could use one of them to a find a way to filter :

If not I’ll do a screen recording :wink:

I would love to see a screen recording, because for now it is not working (and yes I am going crazy as it seems to me like at least 3 filters I tried should work… :laughing:)

Hi @Bruno_Chazel

Here is a screen video, let me know if this not what you want to do or if you have some questions :wink:

1 Like

wooo, looks good !!! :smile:

and the validate / cancel buttons are great too !

many thanks @Lucas_Malguy1 , I am too tired right now to reproduce your app, but I will soon !

many thanks again, and i’ll let you know when I will success to do it ! :hand_with_index_finger_and_thumb_crossed:

1 Like

Hi @Lucas_Malguy1,

I am almost there !

For 1 minute it worked, then … not so much. It worked only for 1 item :sob:

I’ve made a video to show you what happens :

1 Like

Hi @Bruno_Chazel

Good news ! Glad that it’s working!

In your kids table, is your “rel with split already owner” match multiple? If not, the data in your lookup will be a text, which is why then in your choice component filter you don’t have the “doesn’t contain”.

Once match multiple selected, reconnect your lookup :slight_smile:

Hi @Lucas_Malguy1

Merci beaucoup, it worked perfectly ! :ok_hand:

That was actually much more tricky than I thought - I am a newbie on glide, so I really couldn’t find the solution without you.

Encore merci for your help,

have a great day !

1 Like