"Contains List" not an option?

I can’t seem to find the option to have “contains list” available in a constraint I am using. I know I have used this function before in my app. And the data field it is constraining is indeed a list of things. So I am a bit confused here…

Video for reference: Loom | Free Screen & Video Recording Software | Loom

it’s an option conditionally

What do you mean by that? Like it is only an option in conditional statements, not in workflows?

Yes, I believe that to be correct. Think of the contains constraint as “does this list contain an item” and think of ‘is in’ as “is this item in the provided list”

I had thought about that too. But I am not sure that is the case. For example in my use case I was trying to get a list of Users from a conversation and the only option to constrain was contains or doesn’t contain…

But I am trying to do this within a search for “Conversations”

However if I try to search for Users normally within another workflow, the contains list option appears. So maybe it only lets you do contains list on the outermost level? If that makes sense lol?

Posting another video to explain: Loom | Free Screen & Video Recording Software | Loom

Makes sense. I wonder what triggers the availability. Let me play around with it. But maybe you could use “contains current user”?

Use the Advanced: constraint and do anything you want. Like that conversations List of Users = your custom states list of users

Yeah, not sure either. Seems strange to me that there isn’t much consistency with available options.

But I do need it to search for conversations that include the full list of Users for it to work properly. If it were just for conversations between two Users it works fine (which I have already). Trying to allow for group messages though, so it needs to know if these 3/4/5 exact Users are already in a conversation together or not.

Does that make sense?

Correction to what I said you might have to do This conversation's list of users intersects with [your custom states users]:count is [your conversations list of users]

roger makes sense.

Yeah, I agree that both of those options should work. But the issue isn’t necessarily in accessing the list, it is moreso in bubble telling me I can’t do intersect or = or contains list…

Also, I can’t do This conversation’s list of users, because it is the conversation itself that I am trying to access.

Maybe I am missing something?

Looks like you’re trying to find the existing conversation and show that one, so you would do the Advanced: constraint with the expression This conversation's list of users intersects with [your custom states users]:count is [your conversations list of users]:count after the search do :first item

Then your Only when statement should be the same search but :count is > 0 instead of first item.

EDIT: I added another :count

If your conversation would contain the Current user but your custom state doesn’t contain it then you would need to add in your current user so the lists are the same, so you would add :plus item Current User to the [your custom state] parts

That seems to have worked! The part I had forgot about was that you can’t do advanced on the search, but rather have to do the search for thing >> filtered >> advanced.

And luckily, I do have current user in the custom state already so it makes it a bit easier.

Thanks a bunch @tylerboodman

2 Likes

Yep no problem, I’m sure you know already but search constraints are faster than doing constraints in the filter so narrow down the search as much as possible before resorting to the advanced filter.
So your search if you have the a constraint Conversation's users contains Current User that should narrow it down a lot before the advanced filter

1 Like

Hey @tylerboodman, I thought the issue was fixed but after troubleshooting some more I realized that it wasn’t actually.

It looks like the issue is occurring at the point where This Conversation’s list of users is being searched. It is just coming up as (empty) or “null” in the debugger. I am attaching some screenshots below.

Screenshots:

  1. Workflow

  2. Debugger - Part 1

  3. Debugger - Part 2

For clarification on what is happening with my workflows:

  • Group Search Conversation’s Filtered = a set state that is a list of conversations whose users contains current user. This is set on page load.
  • Group Conversation-inner1’s Convo Users = the state that is set when adding users to a new conversation (before it is actually created).

Do you have any idea where I might be screwing this up?

How’s your privacy settings? For trouble shooting purposes, you might clear all on your conversations to see if it shows. Then figure out what you need to do to implement another privacy rule that gets around it.

Hmm, so under data >> privacy allow auto binding for everyone?

Or do you mean to clear all rules? I previously had no existing rules for conversations.

I’d remove all rules at the moment just to see. That’s if it wouldn’t be too pain-staking to put them back. If you had any. If you have any, you’ll need to allow all before you wack the rules

Okay, yeah that is how it is already haha. #norulez :crazy_face:

1 Like