Forum Academy Marketplace Showcase Pricing Features

How to create a new thing from a bulk data in Repeated Group with a single click

Hello !

Can anyone help me in deriving the logic of consolidating and updating from a repeating group by creating a new thing.
Ex:
below is the data from the repeating group (Purchase details)

when I click submit, I need a logic to create a new thing which consolidates the vendor name and adds the Item list to the particular vendor as shown below.

the puchased IDs are created based on no of unique vendors.

Sharing my Application incase if you need for more details.

Appreciate your help.

Do you want to create a single thing for a single vendor, or for each vendor in the list ?

Assuming you want to create a purchase report per vendor …

You will need to run a Scheduled API on a List. The list being a list of unique vendors.

The API will scan this temp table for the vendor and create the purchase report on the list of items.

Worth pointing out that having separate lists like you have in your example is going to be messy…

So …“Almonds, Cashew” and “1,2” … is going to be hard to put back together based on positions (so Cashew and 2 go together).

A better way would be to create a “Report item” thing that has Item and Quantity.

So “Almond,1” and “Cashew, 2”. That keeps them together.

Have a go…and give me a shout if you get stuck :slight_smile:

2 Likes

@NigelG Thank you for your response.

Thats exactly how I needed.
but I haven’t worked on scheduling an API . Was going through bubble reference , but bit tough to understand related to my requirement.
Could you please explain me a sample through screenshots?

Thank you again for your help.

@NigelG

I tried my best to get this done as per your advice but Hard luck. Seems like I am still missing some logic.


Please help.
Link : https://bubble.io/page?type=api&id=testz1&tab=tabs-2

OK, the first thing we need to do is tidy the database up.

Storingthe Vendor Name makes life difficult, so let’s store the Vendor thing instead.

I have update the API workflow a little, we only really need to send a list of vendors through.

Then create for a single vendor in the API.

But it looks like your temporary list is not being populated.

2 Likes

@NigelG

Thanks for your quick response. The temporary list is now being populated.

I tried to run the Scheduled API now but it was creating all individual records because the vendor List consists of multiple records with same vendor name ( as we were referring unique ID of each record).

To avoid this, I renamed vendor table to vendor Items and created a new table Vendor with only vendor names and unique ID to refer.

now the logic works fine by creating unique list vendor to the purchase report database . But all the Items from the temporary list are being added which needs a filter to add only with respect to the unique ID.
Please advice what logic to add for filtering Items based on unique IDs. I tried in multipleways

I think we are inching closer in solving this.

Updated app Link: https://bubble.io/page?type=page&name=purchasing_page&id=mytestingapp&tab=tabs-3

Many thanks for your help.

Here we go…

You need to search for all the temp items that have a vendor with the vendor id that we passed in.

2 Likes

Thank you very much @NigelG. :slight_smile:

I will now try to build the logic on how to capture Item and quantity together as per your advice.
Almond,1" and “Cashew, 2”