Creating multiple things in the database from a multiline input


Please, how do I create multiple things in the database from a multiline input as shown in the pic, I have tried separating with regex but its not giving me the kind of functionality I want. any help will be appreciated.

There might be a regex function that can detect where the enter is hit in the text. Then format this text into a list. And then create things in DB.

This being said what I would do personally is use OpenAI.

  1. Setup Chat Completion endpoint
  2. Instruct it to return a response in a format you like or a JSON file
  3. Store data in the DB

Let me know if this was helpful :v:

1 Like

You really don’t want to use AI if you can help it in this case. It’s slow, it’s expensive, it makes you rely on another company.

Use the data creation API. It’s documented in the manual. So, how do you create the input for each line?

First split the text by newlines (using :split by). Then, use :format as text on this list.

‘This text’ refers to the text in the line. The deli meter will be a new line. Roughly, your content will look like {“field1”: This text: extract with regex:formatted as JSON-safe, “field2”: This te…. etc}.

The regex to extract is the part to work out, and GPT-4 is pretty good at helping with regex. If you can define standard rules you can get it to work. For example, the email will always be a string with no white space that contains an @. A phone number will be numbers. The names always seem to be separated by a comma, so that tells you how to work out the names.

2 Likes

Thank you for your swift responses. I tried setting up a chat completion endpoint, but i dont feel like i know what am doing yet.