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:
![image](https://us1.discourse-cdn.com/bubble/original/3X/e/a/ea819488ad1fbd2282ce9d85949664f86bd813e2.png)
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.
![image](https://us1.discourse-cdn.com/bubble/original/3X/4/b/4b8016228948a9f56a00c379474e878749e7352b.png)
Can someone say what I am doing wrong?
@rico.trevisan ![:upside_down_face: :upside_down_face:](https://emoji.discourse-cdn.com/twitter/upside_down_face.png?v=12)
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
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: :upside_down_face:](http://forum.bubble.io/images/emoji/twitter/upside_down_face.png?v=9)
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: :slight_smile:](https://emoji.discourse-cdn.com/twitter/slight_smile.png?v=12)
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: :woman_scientist:](https://emoji.discourse-cdn.com/twitter/woman_scientist.png?v=12)
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