I’m trying to save multiple text values inside of a repeating group as one entry inside of my database. I’d like to save everything I have highlighted below
Hey! Yeah so all of the text highlighted is in a repeating group. You’ll notice that there is a break in the highlight between each paragraph, this represents the “cell” of the repeating group. I’d like to save the data from each “cell” as one value in my database or custom state.
You can do this with a custom state or some the initial content of some hidden element. Basically, all you need to do is to store the text somewhere, add onto it, and then store it into the database.
Here’s the custom state solution:
create a state on a group. Let’s call the group generated_group, and the state generated_text.
When the 1st cell of the RG is populated, add it to generated_text:
Set State of generated_group → generated_text → current state of generated_text + text of 1st cell. You can look into regex methods for formatting here.
When the 2nd cell of the RG is populated, run the same thing. etc etc.
Create a trigger to indicate when you want this to be saved in the DB, or displayed elsewhere. Upon the trigger, simply save/display generated_state.
I think I can see the difference between the suggestion above and what you’re trying to achieve. Can you attach a screenshot of the Data Source for your repeating group?
The data source is the API’s response. I don’t actually want to save the response as-is to the “transcript” field, I’d like to save it the way I have the response formatted in the text box as pictured in screenshot. Yes- transcript is a text field. Thanks!
Did you find the solution? I am having the same issue. Basically, I am doing some quite complex manipulation on the text response from the API and making three RG-columns out of it. But I can’t find a way to save it to the DB the way it appears in the RG.
Thanks for responding, could you please run me through step by step. Here’s what I got today:
Click Button → Triggers API to OpenAI → provides me a JSON-response where all the answer is in a text, split by /n and ;.
I have a RG with that API response → Split first by /n to get rows → Split by ; to get cells
Chose 1st, Second and last item to get the respective data in the cells.
Now, my goal is to get those columns stored into the DB. API response looks something like this: Day1, Activity1, Coordinates1, Day2, Activity2,Coordinates2, Day3,Activity3,Coordinates3.
What I want is a DB with column for Days, Activity, Coordinates. Every day (1,2,3) should be a separated row. (Basically, exactly what I have in the RG)
I managed to save data to the DB in different columns with a backend API workflow, but as you can see on the screenshot, it would take me only the last item, instead of the last item of every row.