Forum Academy Marketplace Showcase Pricing Features

Entries of a repeating group to database

Hi everyone,

Is there a way to save all of the entries of a repeating to the database all at once ?

Thanks in advance for your help.

1 Like

What are you trying to achieve? Tell us more about your end goal and current workflow.
One generally saves items to the DB as they are added to the RGroup. Your use case might differ, help us understand :smile:

Thank you for your reply George :grinning:
Well I have multiple entries in a repeating group which come from an external API and I would like to add these entries to my app’s database. I know how to add one entry at a time using a button and its appropriate workflow but I don’t know how to add all of entries all at once though…

@emmanuel has a very elegant way of achieving this using the Bubble API that’s coming up (I’ll let him tell you more about it).

If the data is already available from an external API, why would you want to save it in the DB?

2 Likes

Well I want to save it in my app’s DB for several reasons, the main reason being to lower the response time.

I am also trying to save a repeating group from an external API to my Bubble database. Is there any way to do this currently with Blockspring or Bubble?

Not quite yet but soon!

So I found a workaround for this that works great. What I did was create input boxes for each “thing” you want to pull from an external API. So if you’re trying to pull an address and a title, create two input boxes where each will have the external API data as “initial value”. Then you can create the workflow to “Thing”=“InputWhatever’sValue”

You can disable the input on the input boxes and hide them. Now when you submit your form or action, it will pull from the external API, place it into the input box, and then save to your database. Easy fix for copying outside info into your Bubble database.

3 Likes

HI @bam. I’ve been able to take your suggestion (and it works great) on a single thing for a repeating group, but I haven’t been able to do this for all of the things in in the repeating group.

Do you have any thoughts on what the workflow of the button would look like if I wanted to update each row of the repeating group, which each row pulling multiple values from an external API?

It seems like I can’t do this from what Isy mentions here:

Thanks,
Sharon

@sharonherzog I’m not sure if I understand correctly what you’re trying to achieve. Are there multiple columns in each row and you’re trying to add multiple values from the external API by clicking the button? If you could post a couple screenshots of your workflow and layout I’ll do my best to help!

Hi,
I think I am having the same problem that @sharonherzog mentions here.
I able to successfully display the results from an API call (“entity extraction from text”) in a Repeating Group.
However, when I want to store the results in the database (as I want to filter, sort, manipulate the values) I can only store the results as LISTS. I cannot store each “cell” from the repeating group as a separate data entry.

I created this public demo app here so that you can see what I am trying to do:
API results in database

@georgeciobanu do you have any suggestions on how to approach this?

Thank you anyone and all for your help!

P.S.
I wasn’t able to create the demo in the forum app as it wasn’t allowing me to install the blockspring API. Different problem…another time.

You could fudge it in the same way it was done for the multi file upload. So use the itemno to save each one in turn.

Thanks Nigel!
I found this MultiFileUploader in the posts and think it is the one you are referring to.

The problem with this is that the workflow hard codes the ItemNo into the field (max 5).
With the NER results the number of returns is dynamic (sometimes only 1 Entity is returned, sometimes 12).

I am going to play around with a “Do when condition is true” workaround to loop through all of the items returned but not sure that’ll work.

Ok, so using the MultiFile example I am able to populate each entry from the RG into a row in a table…
BUT…

Problem:
The only way I can do this dynamically is by

  1. counting the number of Entities returned by the API - count
  2. running a Custom event every second that enumerates through each cell, then store each iteration in a table until it reaches the max count

This means if I get 20 results back I need to wait 20 seconds to populate the table with all results from the API.

Unfortunately the “Do When Condition In True” event only runs ONCE in the workflow (as also described in the workflow explanation - to avoid infinite loops).

Only other option I can think of is to hard code in a number of times I want to run the script in one event. But that assumes that I know how many times I want to run it in advance…which I can’t as each API call will return a different number of entities.

I updated the example: example app

i have the same use case as @steinhausler–i want to save the API data to my Bubble DB so i can filter and manipulate it BEFORE i show it. i’d like to be able to save my API call data into individual cells, rather than as a big list. has anyone come up with a good/fast solution to this?

thanks!

1 Like

Hi,

I’ve also been trying to solve this for months. Has anyone found a solution?

A syntax within Bubble that allows us to create a thing based on each cell would obviously be very useful…

P

You use the “Schedule API on a List”. The list being the repeating group.

https://buildingonbubble.com/block/save-a-repeating-group-1472016928237x990158512135602200

3 Likes

Thanks for sharing this @NigelG.

I have a question … what if we have an input field in the repeating group ? I need to save the value provided in the input field to the database.

I’ve created the same in Forumapp3 as an example. In this case i would also like to add comments to the database. however I am unable to assign the input field’s value as a parameter.

Can you please help me?

Editor Link: https://bubble.io/page?type=page&name=save_list&id=forumapp3&tab=tabs-1

Hi Nigel,

You’re a genius. How you figured this out I’ll never grasp. You’re really, really good at this stuff.

Thanks very much for your help. I do hope you leave up this amazing example.

Incidentally, I bypassed the RG entirely and just saved the contents of the API call (i.e. without displaying them first in an RG).

I am going to experiment more tomorrow. But this opens up a world of possibilities.

Thanks again,
P

2 Likes

Thanks. Yes, I had also created …

https://buildingonbubble.com/block/save-an-apis-results-1472017471956x981892223072469000

For doing it directly without the RG.

4 Likes