How can i get the data and values out from the ChatGPT output

I used ChatGPT to output this data now i am trying to send them to google sheet but i am not able to get the data from ChatGPT output since it is one variable. Following is my ChatGPT Module Output and Screenshot of my scenario:
[
{
“result”: “Here is the extracted data from the email:\n\n- Rx #: 177290-0\n- Fill Date: 07-03-2024\n- RPh: AE/NM\n- Drug Name: NURTEC 75MG ODT\n- NDC: 72618-3000-02\n- Qty: 16\n- Days: 30\n- DAW: 0\n- Service Provider ID: 1234567807; 01 - NPI Txn / Switch: B1 / RH\n\n- Patient: AHMED, SAAD\n- DOB: 01-01-2000\n- Address: 26 NELSON AVE GMERBURG NJ 07799\n- Phone: 480-720-8800\n\n- Prescriber: AHMAD, WAQAS\n- Phone: 790-260-1122\n- Address: 200 SHAMA RD STE 221 OLD STREET NJ 08901\n- NPI: 1234577495\n- DEA: FA3943289\n- Fax: 833-211-1122\n\n- Insurance: HORIZON NJFAMILYCARE; HORIZON NJ FAMILY CARE\n- BIN: 61001\n- PCN: AZZ\n- Phone: 800-902-2009\n- Card ID: 12345678\n- Group: HORIZON\n- NCPDP Version: D0\n\n- Rejections:\n - 70 - Product/Service Not Covered - Plan/Benefit Exclusion\n - 76 - Plan Limitations Exceeded\n\n- Authorization #: 090953112346024999\n\n- Additional Messages:\n -”,
“id”: “chatcmpl-9hbqJ9EkxJ1k5EkWHuy0GFY9trGhS”,
“object”: “chat.completion”,
“created”: “2024-07-05T11:56:39.000Z”,
“model”: “gpt-3.5-turbo-0125”,
“choices”: [
{
“index”: 0,
“message”: {
“role”: “assistant”,
“content”: “Here is the extracted data from the email:\n\n- Rx #: 177290-0\n- Fill Date: 07-03-2024\n- RPh: AE/NM\n- Drug Name: NURTEC 75MG ODT\n- NDC: 72618-3000-02\n- Qty: 16\n- Days: 30\n- DAW: 0\n- Service Provider ID: 1234567807; 01 - NPI Txn / Switch: B1 / RH\n\n- Patient: AHMED, SAAD\n- DOB: 01-01-2000\n- Address: 26 NELSON AVE GMERBURG NJ 07799\n- Phone: 480-720-8800\n\n- Prescriber: AHMAD, WAQAS\n- Phone: 790-260-1122\n- Address: 200 SHAMA RD STE 221 OLD STREET NJ 08901\n- NPI: 1234577495\n- DEA: FA3943289\n- Fax: 833-211-1122\n\n- Insurance: HORIZON NJFAMILYCARE; HORIZON NJ FAMILY CARE\n- BIN: 61001\n- PCN: AZZ\n- Phone: 800-902-2009\n- Card ID: 12345678\n- Group: HORIZON\n- NCPDP Version: D0\n\n- Rejections:\n - 70 - Product/Service Not Covered - Plan/Benefit Exclusion\n - 76 - Plan Limitations Exceeded\n\n- Authorization #: 090953112346024999\n\n- Additional Messages:\n -”
},
“logprobs”: null,
“finish_reason”: “length”
}
],
“usage”: {
“prompt_tokens”: 672,
“completion_tokens”: 350,
“total_tokens”: 1022
},
“system_fingerprint”: null
}
]


I think i need correct Regex for Text Parser please help

Hey @Noor_Alam ,

  • firstly use these modules :
    image

  • then update your gpt module

  • we can easily map this data

  • In google sheets create a sheet first, give it a name, etc. After that choose the Add a row module and map the result from GPT to the row (name the header whatever you want).

If you are using airtable its the same just add create a record module.

React out to me if you need further help.

1 Like

I am using Airtable where they demand for separate entry that is inside the output from chatGPT how can i get those values:

See Here All these fields are inside the output data from ChatGPT but i dont know how to map them:

@Noor_Alam you need to update the the chat gpt module, write a prompt so that the generated data is in the format of a json, if it is coming in that format, we can easily map this.

Do it and let me know

See the following example, i found a way by adding proper regular expression in Text Parser, now the problem is i am not able to get data from the array collection so that i can send all these collection data into excel sheet or Airtable. you can see the following screenshot the output is different inside array, can you help how to deal with this as only for each collection the number value are there and the rest are empty, i need a way to get all these value from each position and put them in excel sheet: