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
Any ideas on how to save each one of these text elements inside of the repeating group as one cohesive datapoint?
I didn’t got your question. Is the text highlighted, is in a repeating group?
And, you want to capture all the text in all entries, and save it to one feild?
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.
Okay - So this is the track I was thinking down, but I’m unsure of how to trigger the state to be populated when the cell of the RG is generated
is there a workflow action that causes each cell to be populated?
No, I simply have a text block in each cell and am using an API to feed the RG data source.
ah… then you can store the text data somewhere when you call the api?
You can access all the texts in the RG as one comma-separated string using
Repeating Group text's List of texts.
Then just save that to your database.
Is that what you’re after?
Thanks for the suggestion, but I don’t think this will work for what I’m trying to do.
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?
Also is transcript definitely a text field?
Here’s a screenshot of the data source for the RG:
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.
You just need to create a Data Type that is a List of texts.
Then save each of those values from your API into this Data Type.
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.
Help is very much appreciated. Been wasting hours on this.
The opposite of :split is :join with.