Filter out duplicates by sub category

Did I just forget how to use bubble? Removing/preventing duplicates based on a subcategory.
I have marketing “Leads” coming in
Lead

  • list of lead-slots
  • territory
  • categories
  • etc.
    Then I have business accounts that can buy lead-slots to get leads.
    Business account
  • list of lead-slots
  • territory
  • etc.

A lead comes in and searches through “lead-slots” in a territory that meet certain requirements. Business accounts can purchase more than one “Lead-Slot”

If the “Lead-Slot” list on the “Lead” contains multiple slots from the same Business Account
Remove all but 1. So that a “Lead” cannot have more than one “Lead-Slot” from the same “Business Account” per “Lead”.

Thanks in advance.
@NigelG my savior of the past? It’s NickGillis from Twitter.

1 Like

just a reminder that if Bubble encounters a list
eg apple, apple, banana
it transforms the list into
apple, banana

so it removed the duplicate without you asking to do that.
this cannot be avoided.
only thru using something like listshifter or creating new things in the database.

it seems your premiss did not take that into account so I mention this.

That makes sense why I can’t get the count greater than one when filtering by business listing. I tried listshifter but not seeing how to apply that on the backend. I should have probably mentioned it’s a backend workflow.

an example to solve this.
I can have items and a shopping cart
now i want to buy bananas.
I do not know if the user will select 1 or 3 or 5 bananas.
Hence I create a 3rd datatype cart items.

Before creating the cart item with item= Banana and Shopping Cart = This shopping cart I just opened Monday night, I check: does it already exist (do a search for item count is 0 or not).
If exists, I add as many bananas to the cart item it finds in the database, as the user selected,
If no, I create a new cart item with item = Banana, cart = this cart, user = this user. and quantity = 3.

So I am creating things if a condition is met and then counting or comparing those. That can be done in the backendworkflow and by you too.

1 Like

So… in my situation, maybe adding one at a time would prevent the duplicate, because then the constraint can see what’s in the list as I’m building it, and filtering out the subcategory by “this item’s unique element isn’t in this list I’m building”. I only need to create 6 things in the list.

Is this being done on a bulk upload ?

Maybe bubble is getting ahead of itself and not seeing something created in another workflow ?

Not a bulk upload. It’s looking for things/“lead slots” created by users. Basically which users should I send the lead to based on location, distance, job type. It’s a single lead that comes in and gets served based on the “lead-slots”. And each step in this particular workflow is working on something the previous step did.

The second Advanced filter is what I was hoping to accomplish

In which case I can’t see why, in principle, it would fail in the way you described :thinking:

1 Like

I have a faint memory of restricting the list build this way before… dunno.

if you check logs what does it say?
i have had times it times out due to too many/too deep filters (search plus advanced filter)

bubble is definitely changing capacity in backend wflows since last year ie reducing what is available from what i have seen

in this case try to space out the steps or set it up that you have workflow A do depth A, then send results to workflow B that does depth B, etc.

also try to see what happens if you remove 1 filter at a time to troubleshoot

1 Like

I’ll double check the logs. This particular filter is the last one I added and I did try to step it out, even tried running a new API workflow on it. The 2nd Advanced filter appears to do nothing. If it’s timing out on me I’ll really have to re-consider the ordering.

I really appreciate you’re time. I think tomorrow I’m going to try a recursive list building workflow. Get enough of a data set on the first pass to iterate over. List pop workflow state I think will help with that. Lighten the load each time, add recursively until list is x many. Only need six. Thank you.

1 Like

If you use my plugins, don’t forget to tip. Bad things befall those who don’t.

Don’t bet the family farm on Bubble. Also, I’m just reminding people that my “free” plugins aren’t free to those with the means to pay for them. That being said, I hope you and yours will be well.

1 Like