HELP!
I have an array which I wish to extract and group certain strings together, but I’m a bit lost on how to do this.
Background: I’m using Fireflies AI and wish to get the AI summary and create my own Word doc using my template format.
I can get the summary which you gives me as one long string each line separated by \n (a new line). Each summary heading starting with an emoji than **
Example (Random text used, my text doesn’t have full stops aka periods):
“shorthand_bullet”: “
Section Summary one (03:21 - 25:37)\nAtmosphere and Setting: Sunlight filtered through the dusty attic window.\nAnimal Activity: The cat jumped onto the windowsill and stared outside.\nWeather and Ambience: A distant rumble of thunder echoed across the hills.\nAcademic Moments: She scribbled notes furiously before the bell rang.\nScents and Streets: The smell of fresh bread drifted down the cobbled street.\n🌤️ Section Summary Two (25:37 - 39:15)\nAtmosphere and Setting: Sunlight filtered through the dusty attic window.\nAnimal Activity: The cat jumped onto the windowsill and stared outside.\nWeather and Ambience: A distant rumble of thunder echoed across the hills.\nAcademic Moments: She scribbled notes furiously before the bell rang.\nScents and Streets: The smell of fresh bread drifted down the cobbled street.\nSeasonal Adjustments: He tightened his scarf against the biting wind.\nSounds and Nostalgia: An old radio crackled with a forgotten melody.\nMidnight Silence: The clock struck midnight, and everything fell silent.\nAutumn Walks: Leaves crunched beneath their boots in rhythmic steps.\nLight and Shadow: A flickering candle cast dancing shadows on the wall.\n”
I’ve manage to use
{{split(23.body.data.transcript.summary.shorthand_bullet; newline)}}
To make each line in an array.
My end goal in Word is to have in a table, in one cell the section heading following by the summary for that section, then the next cell will be the next section heading followed by the summary.
I thought I could use a filter to search for section heading using contains **, which works, but stuck on how I can then loop until the next one and save all the different arrays of text into one.
Here is an example JSON output from my above set variable module.
[
{
“bulletLines”: [
“Section Summary one (03:21 - 25:37)”,
“Sunlight filtered through the dusty attic window.”,
“The cat jumped onto the windowsill and stared outside.”,
“A distant rumble of thunder echoed across the hills.”,
“She scribbled notes furiously before the bell rang.”,
“The smell of fresh bread drifted down the cobbled street.”,
“Section Summary Two (25:37 - 39:15)”,
“Sunlight filtered through the dusty attic window.”,
“The cat jumped onto the windowsill and stared outside.”,
“A distant rumble of thunder echoed across the hills.”,
“She scribbled notes furiously before the bell rang.”,
“The smell of fresh bread drifted down the cobbled street.”,
“He tightened his scarf against the biting wind.”,
“An old radio crackled with a forgotten melody.”,
“The clock struck midnight, and everything fell silent.”,
“Leaves crunched beneath their boots in rhythmic steps.”,
“A flickering candle cast dancing shadows on the wall.”,]
}
]
This gives me an array called bulletLines.
So using above my end goal would be in my word template table to have in cell one:
Section Summary one (03:21 - 25:37)
Sunlight filtered through the dusty attic window.
The cat jumped onto the windowsill and stared outside.
A distant rumble of thunder echoed across the hills.
She scribbled notes furiously before the bell rang.
The smell of fresh bread drifted down the cobbled street.
Then in cell two:
Section Summary Two (25:37 - 39:15)
Sunlight filtered through the dusty attic window.
The cat jumped onto the windowsill and stared outside.
A distant rumble of thunder echoed across the hills.
She scribbled notes furiously before the bell rang.
The smell of fresh bread drifted down the cobbled street.
He tightened his scarf against the biting wind.
An old radio crackled with a forgotten melody.
The clock struck midnight, and everything fell silent.
Leaves crunched beneath their boots in rhythmic steps.
A flickering candle cast dancing shadows on the wall.
I will not know how many summaries there will be or how many lines of text in the summary it will have. I don’t have to use an array, if there is a solution based on using the input string, then that can also work!
Any help would be greatly appreciated. THANK YOU!