Populate DB with content present on a custom state, present inside a repeat group

I have two elements inside of a repeating group. One multilineinput and a text element. The text element is populated for a custom state present on the repeating group named “tagrepeat”, which receives data from an API.

I created a button to send the content present at the custom state “tagrepeat” to a field present on the database named “tag”. This works great:


The problem is that I cannot do the same with the multilineinput. I tried creating a new custom state to the repeating group named “question” to associate to multilineinput, but do not worked.

When I click at the button to send the content present at the custom states to data base, just the content of “tagrepeat” go-to database.


Can someone say what I am doing wrong?

@rico.trevisan :upside_down_face:

Hey @italogmoura,

Are both fields, for your Flow Thing / data type, defined as Text Lists?

And are you getting any error output, either in your browser window or server logs, when you click the button to trigger the workflow? My first guess is that there is a data type mismatch between what is in the repeating group, and what is in the database.

Another question: are you triggering an API call, which creates the tagrepeat, and later trying to add the tagrepeat and the question to the database? I’m trying to wrap my head around the sequence.

This probably doesn’t solve your problem, but maybe helps clarify? lol

  1. Yes. Both are defined as Text Lists when I create the custom state.

  2. No, there is no error message. But I agree with you that problem probably is something mismatched.

  3. Perfect. I am triggering an API call, which creates the “tagrepeat” (custom state inside one repeating group). Later, I am trying to add the “tagrepeat” AND the “question” (value typed for the user on a input text) to the database, this time when a button is clicked.

For point 1: are they defined this way in the database too?

Something else to consider: You’re using the “add” method, to stick those tagrepeats and question on to an existing database entry, rather than creating a new entry. I’m not sure what you’re doing with the data, so this may not make sense, but you could try creating a new Flow with those two fields, when you click the button.

Maybe a few more screenshots of your interface and workflow could help?

Sorry if I’m just missing something, and pulling in the wrong direction :upside_down_face:

1 Like

You can edit here.

Click in preview and take a look. Click on get data, type something on the input and click on send to a database. After this, take a look at the app’s data. Just the field received from the API call went to the database. The input did not.

Testandomyapp | Bubble Editor

Hi again @italogmoura,

This was pretty tricky, but I think found a solution. It’s a bit hacky, and there is probably a cleaner solution, but this works, so that’s a start :slight_smile:

When you first call the API, you can set the State_UserComments list to also be the state names. Then, set up a workflow action, so that when the multi-line input is changed, the State_UserComments list is changed, using a find and replace, replacing the cell’s state abbreviation (which is also the UserComment, initially), with the content of the multi-line input. See screenshot, or check your demo app for more details.

First screenshot is a successful write to the DB, with the fields changed; second SS is the workflow action to set up the multi-line input.

As far as I can tell, it’s non-trivial to replace an item in a list at a specific index, though if someone else knows how to do this, please chime in: it would make this much more straightforward.

Let me know if this works, or if I can further clarify.

Good luck! I’m not sure what you’re planning with this, but it seems you’re working in the right space :woman_scientist:

1 Like

Take a look at this plug-in. A easy way to solve this problem: New free plugin (9 march/20) - Orchestra! Refer to inside repeating groups cell(s) from outside

Anyway, would be amazing to do this without a plugin.

1 Like

Here is an example of recursion. I save a bunch of scores in a repeating group and sometimes I don’t want to set a score for a given task. So if there’s not a given score I don’t wanna save that variable. Here’s one way that I have saved items from a list.

Another would be to use the orchestra plug-in. It is very simple and I use it to save the same stuff just in a more convenient manner. I can share screenshots of that later if you would like

1 Like

Hello. I need to do the same. Could you share a demo in Bubble editor with me? Thaks a lot