Multi-select items with number of items to create bulk order form that adds row for each

I’m stumped and I’m sure it’s easy, but I’ve been down so many rabbit holes that I’m quite lost. I am creating an app for our local Lion’s Club that operates a local Medical Equipment Loan Locker (https://fox-valley-lions-med-lock.glide.page). We have 144 stocked items (SKUs) where borrowers can take up to ten different items. Volunteers will run the checkout, so the app will not be publicly used.

I need items selected to fill in separate rows in our Transactions table per SKU, but with the corresponding number of items borrowed for each item. The master list of items is pulled from the Inventory Table.

(What I’ve tried so far In Forms)
I have tried the grid data component with number of items “editable”, but it did not fill to separate rows. And per the post 🦾 Data Grid Component in Glide Pages! - #34 by Andrew_Davies there is no inline action button available, which is what I think is needed. The Chat Assistant suggests I do a loop to add the rows? I’m not familiar with a Google App Script (and my tables are set up in Glide, not Google). so I’m stuck there too.

I have tried “Choice” with multi-select dropdown option, but I’m not able to create a row for each item and/or add the number of items needed. Both are needed.

I’ve tried several other approaches but none of them seem to be what I need. Hoping someone can help me with this? I’d be happy to supply logins or a support link.

Thank you for your time!
Lynn

The bot hallucinates sometimes, so take what it says with a grain of salt. Glide does not support any type of looping action (yet).

There are two ways to do what you want.

  • Option 1: This is only available if you have access to the Glide API (Pro plan or higher). So if you don’t, you can skip this option. It involves preparing an appropriate payload to send via a webhook to Make, and then using Make to add the correct number of rows via the API. This is the best and most robust/scalable option.
  • Option 2: Use a custom action with several conditional branches, one for each of the maximum number of rows to be added. Given that you have a maximum of 10 rows to be added, then this might be the easiest option for you. Essentially what you need is a custom action that looks something like the following:
    – If Row Count equals 1, then
    — Add Row
    – Else if Row Count equals 2, then
    — Add Row
    — Add Row
    – Else if Row Count equals 3, then
    — Add Row
    — Add Row
    — Add Row
    – and so on, all the way to 10

It’s ugly, but it may be the only option that you have.

1 Like

Thank you Darren, I think this could work for the selection of items using the Choice with Multi-select option. How would I allow customers to select the number of items to be fed to the corresponding row? (That’s where the data grid theoretically would have worked great).

Would there maybe be a way to create a secondary form where Number of items are updated to the corresponding row that was created in step 1? Or a different component to use?

Thank you so much for your advise! Lynn

I exactly did the same in my App. In my case, I wanted to add multiple sizes to the Product. Its too much work but works great.

This is screen of form.

This is custom actions as indicated by @Darren_Murphy

3 Likes

Looks brilliant! I’ll give it a try and report back.
Thank you so much! And thank you for the screen shots!
Lynn

Pratik, what component did you use to get the form to be a table with columns as shown? I think I understand the custom actions, but I’m still struggling with getting my Item Descriptions to pull from an ‘Inventory Items’ data table, and then have a customer select one of those items and the number of items ordered to to be added to a ‘Transactions’ table.

1 Like

I think it’s just a container with 4 columns layout, but please consider carefully whether that would fit your data structure.

If you can add a visual representation of what you want, we might be able to help more.

2 Likes

As @ThinhDinh mentioned, it’s container with four columns. You have to create columns in Data Editor for each of the fileds.

Here are a few screenshots of what I have tested. Please let me know if you cannot access them on Google Photos.
I thought this would be fairly simple, two data tables, one as a reference (Inventory table) for the full list of medical items that can be multi-selected and then to have the chosen items with the corresponding amounts borrowed writing to the Transaction table.
I’m stumped and afraid I’m over my head. The other apps I’ve created were directories and far more simple!
Thanks in advance for any help you can offer.
Lynn

The multi-select is meant to work like that. It’s not fit for your use case.

I don’t have any better instructions for you compared to what Darren and Pratlk have said. I would have done it with a JSON structure + Glide API call but I think the API is not available for you on starter.

If it’s not too many rows at once, I would show the Items table in a custom collection layout, then add a number entry in that custom layout pointing to a user-specific column, then a button to submit that info to the Transactions table.

2 Likes

In case it is useful for people - Noloco.io can add action buttons to each row. Their data grid component has sort, bulk actions too.

But pricey compared to Glide though (depending on number of users etc)

1 Like

Is it always the multiple items with same quantity or can be different items with different quantity?

Hi Pratik, thank you for staying with me. We always pick from the same items from the multiple item list (Inventory table). And yes, customers will take whatever they need, so it can vary quite a bit. Those ‘sales’ (it’s all provided with no charge) are recorded in the Transactions table.
Thanks again Lynn

Hi ,
Which component do you use to place several fields on the same row ?

1 Like

I am sorry but just to clarify, what I meant is, will the quantity remain same (all time) for multiple items? E.g.
Case 1: Quantity 5 for all selected items
Case 2: Quantity 3 for all selected items

The amount of items can vary with each item ie 1 wheelchair and 4 support socks.

1 Like

Thank you. How many maximum items can be selected in single transaction/order?

10 items is the max per order

1 Like

This should be doable. The only thing you need do is to add another table called “Items” with a relation to that particular order. So when the Transaction/Order form is submitted, using custom Action based on number of items added, the rows will be added in Items table with a relation to the Order. I hope that makes sense.

There are different ways of showing table in form for adding items with quantities. I have done it in one way. How about this?

1 Like