Dynamic row addition in Repeating Group and bulk CRUD of Things using vanilla Bubble

On step 4, how do I create a thing if one of the fields is filled with an option from an option set, as opposed to a text?

For context, I’m building a form to create a contact, and to do it, I need to bulk create Telefones (Telephones), and one of the fields is Tipo (Type):

image

Because of that I’m unable to set this field on the API workflow:

image

Hi @artemzheg great great tips on this topic. I read it several times and managed to follow along until step 3.1. What I wanted to build is similar to @joaquintorroba’s example. I’m able to get the repeating group (type “text”) to work and get custom state (row_content) to store input value like this: id ||| input type ||| input value. But I’m encountering a weird problem…Once the input value has changed (image uploaded or text typed for example), that cell just disappeared, but information about that row still exists in the custom state (row_content). Do you know what I might have done wrong here?

Have you ever had a similar problem like this @joaquintorroba ?

UPDATE: It is NOT a bug from the bubble side. It has to do with the way custom state is set up like so:

To avoid the row_contents cumble together and no longer be a list on second/third or more change on the input field (i.e. second/third trigger of the custom event), I use “split by( , *** )” instead and then “each item: find and replace” (find the ’ ** ’ left in the beginning of each list and replace with ’ ***** ’ again). It worked for me this way but if anybody has better solution, feel free to let me know.

1 Like

I had the same issue @peanutbutter. The way I solved it is similar to yours with some nuances:

  • I’m using split by “/////”.
  • Each text (“input type” and “input value”) have a “find and replace” to replace the commas so they don’t break the “list” of the custom state. In my case: (find = “,” | replaced = “#%?¿”).
  • To showcase both inputs I reverse this. Meaning adding again “find and replace” (find = “#%?¿” | replaced =“,”).

Btw, amazing tip @artemzheg.

Fantastic ! Thanks for sharing all of this great and detailed explanations.
Quick Question : will it be possible to use this approach to bulk creating things with all of the information displayed in a repeating group (on which I have calculated field) displaying data from a Data Type that I want to store in another Data Type including the calculated field after loading the page that contains this RG… in this case I can not trigger the custom event to collect values when inputs values changes as the RG will only display the values that I want to store in another Data Type

Could you share some example with screenshots for me to understand it better?

Thanks for your reply, but I found what I was looking for.
But now I have another issue :
After following all of your steps I now have a problem to complete the information related to the "Schedule API Workflow " associated to the “Create tasks” button to run the API workflow defined in the background as you indicate . As you will see in the screenshots below I can not associate the row_numbers, row_content or index at this level … I can only associate them in the background side… Sorry this is the first time I’m using the recursive API workflow :



I think I have well define the API workflow in the background:


image


@sam.leroy Not sure if this is the correct way of doing it but it works for me to create the task.

Video below to help understand

Hey @msgiblin ! , have you been able to implement this into your app? I have a similar use case as you and struggling to put it together. Specifically setting up the quasi-Thing and the custom states. Do you mind sharing? Thanks!

1 Like

Yes I have - ultimately creating the list of things via API worked, but I realized in my use-case, I didn’t even need that (or the WU usage) so now I just store the concatenated text with the built-in separators directly on the parent thing and it works flawlessly, and with minimal WU usage. It allows users to edit recipes with almost no WU usage (all custom states), and when ready to save, roughly 1.5-2WU depending on the complexity and size.

My page has a custom state called ‘Ingredient List’ of type text, list:
image

When I load the page, this state is set based on the recipe’s list of text:
image

And here’s what each line looks like on the Recipe data type:
Old Tom GinIII1IIIOz.III66III66III1720048399887x828282648553764000III1III0.4III9.48III0III0III0III0III0III0III0III0III0IIILiquorIII0III0III0III0III0III0IIIIII1III1III1III0IIIno

(note: I’m actually going to recreate this as JSON but the idea is similar - think of this as a row of data, with columns, separated by ‘III’ - which I only used because I control this data. It’d be better to use something odd like &%^ if users have any chance of inputting their own values into this line)

My repeating group is of type Text has this custom state as it’s data source:
image

I then have a custom event I trigger whenever a value changes:

Here’s what that Arbitrary Text is doing in the Find & Replacce: (I have a lot of values I’m changing in the row!)

And this is what I looks like when I trigger it and fill in the values:
image

Again since I no longer schedule an API workflow, I don’t have those screenshots to share, but I used to and it worked well. Here’s how I’m saving the data, and an API workflow would call the values in a similar manner:

image

The other thing I did, was when the ‘Edit’ button was clicked, I generated a very large random value, mixed with text, symbols, and numbers, to preserve it’s uniqueness, as a custom state. I had a field on the list of things I was creating for this number that i’d include on each one. I then had a popup that looked like this, triggered when ‘Save’ was clicked (and the API workflow had begun), which was running a count of things in the database with that unique value. It would disappear when the number of things in the database equalled the number of things it was scheduled to run on. So it gave a nice UI/UX for the users while the backend ran.
image

If they were creating a new recipe, I also had a go-to-page function that would engage only once this popup cleared - so what they see is a ‘save/creating’ dialogue which ultimately sent them to the new page.

Now that it’s all text/custom states, and no backend WF, this is rather instantaneous!

1 Like