Create a single text from multiple data records

Hi all, I’m hoping someone can give me some ideas on this as I’ve tried sooo many things and nothing has worked.

I’ve set up a backend workflow that reads a response coming in from AssemblyAI when an audio transcript has been completed. This returns the identified speakers and each of their texts, which is nested within the JSON as “utterances”. Using some previous posts (very helpful) I have managed to created each utterance as a new record in a single data table using “Schedule APi workflow on a list”, as below:

What I actually want is to join together all the “utterances” in a single text record, so:

Speaker [speaker]:
[what they said]
Speaker [speaker]:
[what they said]

etc.

I’ve tried setting up a recursive workflow based on the previous workflow’s results, as below:

but this doesn’t work. I believe it’s because the workflow doesn’t know when the “Workflow on a list” has finished? So I tried changing the first workflow to NOT be on a list, but this doesn’t work either because the input I’m using is the JSON list that AssemblyAI returns…tried many other things too, but just not getting anywhere. Can anyone advise on how I can do this?

Are you trying to join the things in your database as text? If so, it shouldn’t be hard. You will just Search for conversations:format as text. Format as text receives a list of things and able to return a text version. You can put each item in anyway you want with any delimiter (separator) you want (like new line, comma etc).

Hi Hergin, thanks for the ideas! The challenge with the approach you have suggested is that the formatting I need is quite specific, ie:

Speaker:{speaker_name, which is field 1}
{new line}
{speaker text, which is field 2}
{new line}
And then the same for the next record and so forth. I don’t think I can do that with the approach you suggested?

It looks like you can, yes. Give an exact set of examples so I can clearly see. Again, format as text gets a list and returns a string in anyway you want.

That would be great if I can… here’s the data layout:

Which is what I get back from AssemblyAI. I’m only interested in two fields - “speaker” and “said”, and the data needs to be sorted by “start”.

What I’m aiming for is something that looks like this:

Speaker A:
Hi, how are you?

Speaker B:
I’m fine thanks, how are you?

Speaker A:
I’m good too. Can I ask you some questions about your cat?

Speaker B: Sure.

etc.etc.

Here is the example data I created in mine:

And the output in one single text:
image

And this is the text source:

There are two new lines (press enter twice) in the red-circled area.

And here is the editor if you want to check details: Test for Forum 12 | Bubble Editor

1 Like

Oh wow, that’s terrific, thank you very much. I will get on and try this now.

Worked perfectly. Thank you very much

1 Like