How To Separate Open AI Response Into Bullet Points

Hi, I’m getting a response from open AI similar to this:

“1. “The Secret Formula That Gives You Instant Relief from [Primary Pain Point]” 2. “Unlock the Hidden Power of [Mechanism] and Achieve [Desired Result] Faster Than Ever Before” 3. “Finally, a Solution That Breaks Through Your Roadblocks and Gives You the Results You Deserve” 4. “Discover How [Offer Name] Eliminates [Primary Problem It Solves] in Just Minutes a Day” 5. “Stop Wasting Time with Competitors’ Outdated Methods - Try Our Revolutionary Approach Today!””

What I’s like to do is have each new bullet point on a new line. I’ve been unsuccessful so far working with the functions to do this. Any help would be greatly appreciated. Thanks!

What I’m looking for is below:

  1. “The Secret Formula That Gives You Instant Relief from [Primary Pain Point]”
  2. “Unlock the Hidden Power of [Mechanism] and Achieve [Desired Result] Faster Than Ever Before”
  3. “Finally, a Solution That Breaks Through Your Roadblocks and Gives You the Results You Deserve”
  4. “Discover How [Offer Name] Eliminates [Primary Problem It Solves] in Just Minutes a Day”
  5. “Stop Wasting Time with Competitors’ Outdated Methods - Try Our Revolutionary Approach Today!”"

If you can work with a repeating group of list items in an ordered list to give you the sequence, you can make this nicely formatted

Then the problem is taking your blob of text and turning it into an array we can feed into that repeating group. To do that, you could do a split on some known sequence of characters (like the fact that it’s number + dot + space) using the more-advanced regular expression vision of javascript’s built-in split function. E.g.

result.split(/\d\.\s/g)

And then populate a repeating group list with the elements in the array.

This is a beginning - and assumes you’re doing all this in the front-end (I would have a back-end that is talking to openAI, and that backend - say, Xano - might be able ot take care of the text manipulation more easily too)

Does this give you a bit to start with?

Thanks! I ended up just going with a repeating list and used a split function to separate them into an array. Normally I do want to use a backend but in this case I’m building access to a piece of my app, which is a clone of a page, that is used as a lead magnet and doesn’t tie into the backend or save any data.

1 Like