Assigning items Is this the right way..... Quick question on how you would set this up

Hi, thanks in advance for any advice. I think I know how to do this, just not sure if this is the correct way. Amature question.

Here is my scenario. One of my reps goes into a store and does an inventory count of all products, takes pics. adds comments etc.

The rep adds the “product” of ours they have into our database. So I have the search by rep working. (meaning the item is now tied to that rep for lookup.)

What I want to do though is now assign that inventory to the customers ID. So the store can see what they have in inventory at anytime (for reorders etc).

Is it truly as simple as adding a field to “product” Client ID for example? (and would that be a “user” or “text” for field type?)

Then blocking out any other Client ID on the conditions or work flow?

So when the store logs in they can only see there items and no one else’s?

Thanks again.

It could be, but that likely is not optimal.

You should have a data type called inventory, with a field of product, field for shop and field for qty…then the shop can search for their inventory and see all products in inventory and the qty of each.

Thanks a million for the response.

I probably asked the question incorrectly as I only want them to see their own inventory on my site.

But from thinking through your response, I realized the missing piece in the logic I was missing and it was so simple.

Thank you again. Really helped.

Yes, the setup I described does that in the most efficient way

boston, Humm, I might be still missing something with your response.

Ok, So a rep of mine is at a business to take inventory. Say inventory control for that location only. He adds each item, takes pics, condition and quantity etc,

He does this through his “reps” add a product form,

But I need two things then.

  1. For the rep to be able to see inventory by client ID, which makes since from what you said for a search.

Where I am confused.

How I assumed it work is, the rep adds that specific client ID (the business) in the “products” database.

So when the Client logs in, I can make it to where the product repeating group only displays the items that are tagged by that client.

So do I still do the inventory database for that?

See thats where Im confused.

Thanks sorry.

In Bubble every data entry gets a unique ID, so, if you have a data type of client, the ID is the unique ID…when you want to create a data field to show a relationship between product and client, you will create a field and make of type client, which essentially is the ID of the client and allows you to access all of the fields on the client data type.

This makes it such that you do not want to for the most part to have lots of information coming through unnecessarily, and to avoid that when possible, even if that information might just be the unique IDs of related things.

So, if you were to have a data type of product with a list of clients as a field related to list of clients data type, then you’ll, every time searching for products also be retrieving all of the unique ids of all of the clients on all of the products. An unnecessary amount of information to retrieve.

Additonally, fields that are lists have built in max of 10,000 items, so if your product data type has a field that is a list of clients, at most can have is 10K, and if you are using a list field, it becomes less peformant to do a search once that list goes beyond 50 or so items.

This means that having a data type called product with a list of clients as a field is less performant and less scalable than have a data type called inventory with a field for client and a field for product.

Set rg to type product, do a search for inventory with constraint of client is current user client and followed by each items product…this gets you all the products in the clients inventory…whats more with that, when you have field of qty, you can more easily add necessary features to sort by or filter by qty so clients can see what needs to be discounted or reordered.

I see. I understand it now. Thanks for your time.