-1

I'm new to Google Scripts and struggling to optimize a code I've found.

I used this base to extract the emails from Gmail and feed them into a Google Sheet, and that's working fine.

However, I would like to either extract what is in the "getPlainBody()" String to another column or find some other way to separate out specific data from the body of the email.

I was trying to use (\d+(?:.\d{2}) from here to automatically record times, but I'm not sure where to input the function into my overall code (or if I need a separate code).

How would I do this?

Thanks!

  • Welcome. or find some other way to separate out specific data from the body of the email. You'll need to be provide much more specific information about the content and structure of the body of the email as well as any part that you want to separate out. – Tedinoz Dec 16 '20 at 0:07
1

I would like to either extract what is in the "getPlainBody()" String to another column

Inside your loop, add:

var body = messages[j].getPlainBody();

then modify the appendrow() to include the body.

ss.appendRow([msg, sub, dat, body])

Not the answer you're looking for? Browse other questions tagged or ask your own question.