Entries of a repeating group to database

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: Forumapp3 | Bubble Editor

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

Hmmmm, interesting one @samuel - will have a think :slight_smile::nerd:

2 Likes

Hi Nigel,

Taking a closer look at your google places app.

Could this also be a generalized solution for entering multi-row API responses into a database? My use case seems pretty routine. Do you know if there is a simple solution?

Yes, as long as bubble thinks you have a list … Schedule an API in that list.

2 Likes

+infinite likes!

Do you know if “list to run on” in the Schedule an API on a list can accept a table not just a list from a single field (ie. place)? Also, do you know if “list to run on” needs to run a GET to the external API or can it be a POST response?

My external API r_pair_info is a table (red text). I’m POSTing data from Bubble->R and the response is a table.

that looks like this:

Your list will be the result of an action in your workflow I would think.

So do the post and then pick up the “result of step x” ?

Hi @NigelG

Any Luck in finding solution to my request?

Regards