Conditional Filter "Is one of" bringing back too much data

Hi,
I have a scenario with Books and Authors. An author can write many books and a book can be written by many authors - n:m relationship.
The data is in airtable and I use autonumber field as the keys.

I have an authors page and I want to show their books. It has a list-details block for the author and a list block for the books
With an “is” conditional filter on the list block, it only brings back the books where that author is the only author. This is correct and expected.
However if I change the conditional filter to “is one of” it brings back books where the id of the books author is part of the author id

E.g lets say I have Book “A” written by Authors with Id 1 and Id 3. The conditional filter “is one of” is bringing my back the list of books where 1 is part of the books Author id eg 1, 10,11,12,13, 14, 15,… 21 etc. It should only bring back books that have the Author ID 1, but not 10,11, 12 etc

And when I look at the Author page for Author Id 3, its bringing back books written by Authors with the ID 3, 13, 23, 31, 32, 33, 34… etc Again it should only bring back books with Author Id 3

Hi Nigel,
I don’t think this is a bug, though it’s impossible to solve it without a screenshot of your conditional filters for the list of books + a screenshot of the airtable table (with linked records from authors to books or else).

Then we will be able to really help.

Hi
A
Screenshots included (Actual table names are different to the original post). As you can see Marty Cagan has a People Id of 1. The page should only bring back two “Content” records, those with Id’s 1 and 2. But its bringing back all content records where the Person Id includes a 1 in the number .




Thanks for putting all this together.
I may have a solution.
Can you just add a formula field in your people table. Enter this formula: RECORDID() and press “create field”.
After this is done, create a look up field by right clicking on Person ID in the content table.

Go back to Softr studio and enter this conditional filter : ‘recordId’ ‘is one of’ “People ID’ record id”.

You also can do the exact same setup without creating a new field: use the conditional filter “name” is one of “People ID’s Creators(from people ID)”. Though the recordId method is the safest way to set conditional fitlers up, whatever the kind of app you are building. This is the real unique thing to identify a record without any mistake, a true unique identifier.

I suspect that the number field you take as a conditional filter takes, by default, any digits of a number (as you mentioned)

Tell me if this works.

@artur Is it a normal behaviour from conditional filters when filters are ruled by numbers and digits? I understand the point of Nigel even if there is a solution

Hi @matthieu_chateau and @nigelfar will check this tomorrow during the day and let you know. Overall our is is stricter than is_one_of and given we don’t have other granular options like contains, startsiwth, endswith (which is by the way planned to be added) it’s probable but let me double check that… is there a link you can share so I can check it directly on real example ?

@matthieu_chateau’s suggestion would work for sure.

1 Like

Thanks @matthieu_chateau - the RECORD_ID() idea does work. It’s not very intuitive to have to do this though.
@artur Its’ really simple to set up an example - you just need a m:n relationship between two tables, using autonumber fields as keys.

1 Like

Hello @artur !

Since a recent update of List block, the “Is one of” selector is not working anymore for me.

It worked on a non-updated block. For example, I have a Product with a Categories field. In Softr, I have a “Suggested products” list under the Product block with a filter → Categories - Is one of - Product’s Categorie

And now I just find the current product in this list, not the other which share some of the categories, contrary to before.

Did you observe this new behavior ?

@Charles do I get it right that right that product has few categories and they need to be matches with other products having same categories ?

Exact!

Ok I will be doing tests tonight see what might be the issue. can you help me to see the type of the category field too ? @Charles

@artur it is a multiselect field of value

Thanks @Charles reproduced here: https://darin556.softr.app/ we are going to fix tomorrow.

1 Like

You are so quick Artur, what is your secret?!

@Charles should be fixed

1 Like

it’s working perfectly, thank you Artur !