Repeating Group: One thing created by 2 people

Hi anyone,

I have a repeating group that searches on a thing eg:

Type of Content: Cars
Data Source: Search for Cars

I want it to display Cars created by Current User AND Cars created by Admin, sorted by Created date descending.

Everything I try gets rejected in red and I can’t understand the error message.

If I only do Created by Current User, sorted by Created date, it works fine so it’s me trying to get Cars created by 2 different people to display.

It sounds like it should be easy…

Any ideas?

Can you share a screenshot of your setup? You should be able to use a :mergedwith function, so the data source would like like Search for Cars (constrained to current user) merged with Search for Cars (constrained to admin) sorted by Created Date.

Here’s a quick link I knocked up. I can’t find where a :mergedwith function is…

if link doesn’t work:

https://bubble.io/page?name=index&id=bubblerz&tab=tabs-1” without quotes

Click on the more… in your Data Source and scroll down a bit …

Do a Merged With and add another search.

1 Like

Where do I go from here? I enter another search to look for Cars created by a user with Admin=yes? That throws a red error when I try to do that. screenshot:

OK, so you need to pull back your admin user to then search for Cars created by that user.

So we do a Created By = Search For User …

Then pull back your admin users …

You will get an error, because bubble only wants one user, so you tell it to find the first admin user it finds with :firstitem

1 Like

Perfect! Thanks! I think I get this now - if the field in my database is not a list then when I use constraints I have to state “first item”. If the field is a list, I wouldn’t need to use “first item”. That’s why the error was talking about expecting a list - it wasn’t talking about expecting a list in the repeating group, it was talking about expecting a list in the database field.

Yes, that’s right.

If Bubble is expecting a single thing but you have a list (even if that list will always be one) then you can make it a thing by using “firstitem”.

If Bubble wants a list, you can make a single thing into a list by using “converted to list”.