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.
- Setup Chat Completion endpoint
- Instruct it to return a response in a format you like or a JSON file
- Store data in the DB
Let me know if this was helpful
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.
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.