Best Practice to create the tables

Hello there,

So, I’m having this inconvenient. And I want to make it right from the beginning.

In my app, you ask for insurance quotes. Many of the proposals, will be uploaded by me. So this is log

User Signs up
User requests a quote on home insurance
User can request a quote on business insurance, auto insurance, etc…
Admin uploads proposals to that quote request, for the user to compare.

Now I have a table for each kind of insurance

For those who don’t know spanish, it’s
Home
Auto
Business
Quotes Request Table (to assign a number to each home, auto business quote request)
Proposed Quote (to save each insurance carrier proposal, to each requested quote)

But i don’t know how to make a new entry in “quotes reques table” every time a new home, auto, business request quote entry is created.

Let me tell you the planned UX

I want to list in user’s profile the a list of the requested quotes, regardless the branch of insurance. That’s ok because i can in each table (home, auto, business) have the “user id field” to be filled with “current user”
BUT

PROBLEM Ai can’t create a repeating group listing data from different tables.

And I want a page only accesible by “admins” where I want to see a list of all these requests from every user who requested them. In order to “upload” insurance proposals to each of them (kind of a back end)

PROBLEM B When I try to make a repeating group, listing every request from any user in order to assign proposals to it

Maybe I’m in the correct path, maybe not. Please, Experienced bubbles, could you tell me how you would do this?

Thanks in advance!

Hi!

I think you have several choices on how to approach this:

The easiest way would seem to be to have a separate repeating group for each insurance line with a subheading - ie Home, Auto etc…

Alternative - you could use merge to merge the tables together - but I would think you’d have to be careful as if the data is different - ie you have auto price field and home price field then your display data may be empty.

Otherwise logically, can you not have one table for all insurance and then put a type field - ie Home, Auto, business?
Including the shared common fields - ie price, quote date etc… that way you could use the one table for the repeating group as it rolls up the common elements from the underlying tables.

I think you should consider these data table organization concepts before proceeding and test it out with a few small examples to see what may work best for you if any :wink: You will probably come up with a better solution by just playing around with it and approaching it from a different angle.

Thx for the merge option! didn’t know about it

yes, doing 1 table for all could be easier, but would be a giant table because each kind of insurance needs different data (for home there is a lot of different coverage limits, lot of other data for auto, etc.)

How can I associate many “insurance quote proposal” (from all insurance carriers) to one “insurance quote request” (from each client)?

Im tryin to accomplish that when the user logs in, can see the proposals for the insurance quote request

Each quote request will have a unique id generated on the table by default. I’d use that unique id as the “key” and put it on the quote proposal table.

could you add a screen of that?

Sure sorry - it wasn’t clear…

You’d do it from the workflow on the part where you are creating the quote proposal.

Just create a field called Quote Request Unique ID and assign it the unique ID from a search like the following:

In this example I assigned a Like Table item number the unique id of a search for a 10Q.

Make sure to set the search parameters correctly as well for the Search for thing:

Then you can use the Unique ID as the “key” when you do a search to match both of those tables together - request to proposal.

hmm i’m still lost, let me try to go further with an example.

User Fills a “construction insurance request”. There is a data type called “Cotizacion Construccion” where all important data for a construction insurance quote gets stored

I have a workflow that fills that construction data type

And I have the “general insurance quote requests” (solicitud cotizacion) that should not have all the deep information for quoting, I did this in order to have a “fast list” of user’s quote requests in order to have them ready for notifications in future. (Ramas de seguro means insurance types, like auto, home, business insurance, etc.)

now hands on it, this “construction quote request” should create a new thing in "construction quote request "data type, (which it does), but also a “general quote request” that should match the id for construction too. The thing is that I cannot create things from different data types

Let me know if this helped explaining my question

Ok - that’s clearer.

I would suggest after Step1 adding a Step 2 with a new data create for the other data type that you’re trying to create. This way you can first modify the construction table then second modify the general quote table.

Here’s an example where I first change the Likes table then second change the 10Q table in the same worklfow:

In the second step you can do a search for the :first / :last item in the construction table to get it’s id to add to the general table if you don’t already have it on the page somewhere.

Then you can modify multiple data tables but you just need to do it in separate steps - does that make sense?

Sure! thx! i fixed it this way (logically explained)

  1. Every new quote request, regardless insurance type, creates a “general insurance request” table thing.
    (to create an unique id, i do a count for, general insurance request +1) That’s the unique number for identifying quote requests. regardless insurance type.

  2. A 2nd step, when the specific insurance table is filled, instead of using a new id for that insurance type, it uses the “general quote request id” from step 1, and puts it in a field “quote request id” (every insurance type table will have it, but the numbers will be created from the table that is general)

STEP 1 (a quote for construction insurance for example)

STEP 2 - All data regarding insurance type, (construction insurance in this example) gets filled, and uses ID from general quote request table, generated in step 1

You think this could work in long term? or may I hit unseen walls ahead?

Thanks a lot @john3! :v:

1 Like

Awesome.
I knew you’d figure it out :wink:

That’s exactly the right way.

2 Things to be wary of:

  1. obviously if you change the data table it may effect your workflow so be careful about renaming items as even capitalization matters.

  2. sometimes there is data latency depending on your bubble plan so step 1 may run slower resulting in step 2 not receiving the results. You could put in a delay between the steps or do a check for the most recent entry then display a error message if this happens. But I’m paranoid so otherwise you may just run it the way it is and watch for any reported issues knowing this might be it…

1 Like

just hit another wall here i think…

How can I “fill automatically” each time a “general quote request” based on the page they are requesting the quote?

Example case:
When user is filling inputs for “home insurance”, that will end in home insurance table, I want 2 things to happen

1st , I want that the just created entry in “general insurance request” “rama de seguro” field will be filled automatically with only one option from the " Ramos de Seguro" data type.
It’s basically, that in “general insurance request” a field preset option fills the “insurance type”. But cannot be text, i want it to be one option from the database

Did you try doing this in the workflow? It seems to me that you can. Try that and put a pic here if it it doesnt do what you want…

sorry for this… but… how?

Hi John, how do you that? “You could put in a delay between the steps”.

In my knowledge, this is only local, not on Bubble server. So step 1 and step 2 are not affected by Pause Before NExt Action.

Good point. I always put a “processing” image that is displayed for the time duration between the data steps. I never encountered the issue again after doing this.

1 Like

sorry for the basic question but how you do that in the workflow?