Splitting chat GPT response into seperate variables to add to rows in a google sheet

What are you trying to achieve?

Hi everyone,

So I am basically making a resume screener that downloads pdfs from a google drive, turns them to text and passes them through Chat GPT to summarise it into 4 sections & am looking for a way that I can add these summarised points into 4 seperate rows in a google sheets document.

Steps taken so far

I am currently up to the point where I can get the reponse from chat GPT and have tried a few methods to doing this but a bit stuck. From doing a lot of research it looks as though I need to parse through the Chat GPT output and turn each section into variables to then pass to a module that will ad these to a google sheets row. I am struggling with creating these variables I tried adding to my prompt to seperate each section with $ signs to make it easier to create these variables but still no luck. See image attachment. Any help would be great!

Screenshots: scenario setup, module configuration, errors

Welcome to the Make community!

When reaching out for assistance with your regex pattern for a Text Parser module, it would be super helpful if you could share the actual text you’re trying to match. Screenshots of text can be a bit tricky, so if you could copy and paste the text directly here, that would be awesome! It ensures we can run it against test patterns effectively. If there’s any sensitive info, feel free to change it to something fictional yet still valid by keeping the format intact.

Providing clear text examples saves time on both ends and helps us give you the best possible solution. Without proper examples, we might end up playing a guessing game, and nobody wants that as it is a waste of time! You are more likely to get a correct answer faster. So, help us help you by sharing those text snippets.

Please format text in code blocks:

A. Type code fence manually
Either add three backticks ``` before and after the text, like this:

```
content goes here
```

B. Highlight and click the format button
Or use the format code button in the editor:
Screenshot_2023-10-02_191027

samliew – request private consultation

Join the Make Fans Discord server to chat with other makers!

Okay thanks, so this is just a dummy resume I am using so no privacy involved but I am trying to split each one of these and not really sure how to do it and save them into variables for later use in another module:

$Hayden Smith$

$Previous work history: 7
Communication Skills: 8
Resilience:7$

$Park Hill Soccer Club Canteen - Park Hill Secondary College- 3 months - Volunteer
Argo Newsagency - Newspaper deliverer - 8 months$

$Hayden is a reliable and hard-working year 11 student seeking customer service work. He has displayed good communication skills, numeracy skills for cash handling, and strong ability to work in a team. He has gained customer service experience while volunteering at the soccer club canteen, as well as experience in handling cash as a newspaper deliverer. Hayden has also demonstrated leadership skills through his roles as a soccer umpire and assistant coach. In his spare time, he enjoys playing and watching soccer, football, and cricket. $

Welcome to the Make community!

You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):

\$\s*(?<text>[^$]+?)\s*\$

Proof

https://regex101.com/r/hDgoOy/1

Important Info

  • :warning: Global match must be set to YES!

For more information, see Text Parser in the Make Help Center:

Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.

Hope this helps!

samliew – request private consultation

Join the Make Fans Discord server to chat with other makers!

Thanks this worked perfectly but the only issue I am getting now is when I am trying to set up the 4 bundles as variables it is only letting me map the 1st unsure why this is. any ideas?

Just to give some context on previous point the parser is making the 4 bundles but I cant turn these bundles into variables or map each one I can only map the 1st bundle?


Hi @Jack_Dearman

We have explained about the same in detail in below video tutorial.

Watch Here

Here, the prompt in OpenAI module is explained in detail. It is always better to be in the form of a JSON structure.

Regards,
Msquare Automation - Gold Partner of Make

Book a Free Consultation | Connect Live

Explore our YouTube Channel for valuable insights and updates!

3 Likes

Thanks for this that video is extremely helpful, one question I have is there any way to add a linebreak between the JSON items that I map into my google sheets. So I can have rating like below in one cell:

Previous Work : 5
Communication skills: 5
Resilience: 5

All in the same cell on different lines is there like a symbol for a linebreak that I can use in the mapping area to seperate these elements to a new line?

1 Like

Every result (item/record) from a match module will output a bundle. To “combine” them into a single structure, you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module.

samliew – request private consultation

Join the unofficial Make Discord server to chat with us!

You can select the special variable newline from the variables panel, or manually type

{{newline}}

samliew – request private consultation

Join the unofficial Make Discord server to chat with us!

Hey - I made a video on how to do this: TikTok - Make Your Day

TLDR is you need to use JSON mode output.

1 Like