Only take the latest email and not the whole chain

Hello, great day everyone! In a bit of a pickle.

I have an automation that includes three apps. Missive → Make → Airtable.

I have a Watch New Message for Missive as a trigger for me to get the message ID of new emails, that then goes to an API call that pulls the whole email body and then gets saved to airtable.

My problem is, when emails come in the whole chain gets saved to airtable, is there a way to remove the other emails in the chain and only take the latest email that comes in?

Screenshot of Make Scenario

Screenshot of current output

Messages inside the blue box is the message that I want to save, the ones inside the red box are the other emails in the chain that I don’t want to include.

Thanks so much!

You’ll have to use a Text Parser Match Pattern module or replace function to match or remove whatever you want/don’t want.

If you need further assistance, please provide the following:

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.

  • Either add three backticks ``` before and after the text, like this:

    ```
    text goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

samliewrequest private consultation

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

2 Likes

Thanks so much!

I’ll put here the whole text that I receive then under it I’ll put the text I want to go to airtable and the ones I don’t want to go to airtable

Here’s the whole text that currently goes to airtable

Also, can we get on your schedule in the next week or so for a 30-60 minute meeting?



Thank you!

Doreen J. Van Ooyen




On Tue, May 28, 2024 at 8:35 AM Multiply Advisors <sample@sampledomain.com [sample@sampledomain.com]> wrote:
Good morning Joe - yes with the info we have now (well... that Doreen technically shared a while ago 😊) we should be able to work towards getting something pretty accurate by the end of the month. Let's say early next week we should have a P&L ready to share.
On May 28, 2024 at 8:29 AM, Joe Van OOyen (sample@sampledomain.com [sample@sampledomain.com]) wrote:Good morning, I would like to see if it’s possible by the end of this month that we could have everything we need to generate a P&L for Mentor Capital , South Carolina , And Mentor Capital Greenville. I’d like to be able to give them minority owners an update and then also show them exactly what we’re at


Thanks. Joe V

On Tue, May 28, 2024 at 7:55 AM Multiply Advisors <sample@sampledomain.com [sample@sampledomain.com]> wrote:Thanks Doreen.
We've attached the AAA Sewer P&L for 2024 and the Balance Sheet as of today - we'll likely need to do a bit of cleanup but otherwise yes we'll plan to send on the records as of 5/31.
On May 26, 2024 at 8:32 AM, Doreen Van Ooyen (sample@sampledomain.com [sample@sampledomain.com]) wrote:I would not be able to determine what the true A/R is in the company. I would suggest we reclass the balance in the A/R account and call it done. And then as of 5/31/24 we will close the books with Multiply and forward the records on to the partner. Thanks
Thank you!Doreen J. Van Ooyen

On Fri, May 24, 2024 at 7:54 AM Multiply Advisors <sample@sampledomain.comm [sample@sampledomain.com]> wrote:Hey Joe & Doreen,Please find attached the XXXX XXXX XXXXX and Loss Statement for XXXX XXXX
We'll need to make a few changes to the Mentor Capital SC report based on our discussion last night before that one's worth sending over!Key highlights include: * Revenue: $ XXXX
 * Expenses: $ XXXXX
 * Net Profit (Loss): ($ XXXX)

Three items that stood out this month: 1. The business experienced a sharp decline in revenue in April compared to March, with a minor reduction in labor costs and stable marketing expenses during the same period.
 2. Given the business's labor-intensive nature, it's practical to adjust staffing levels regularly in response to changes in workload or demand.
 3. This is not directly related to the Profit and Loss Statement, but it will impact financial performance: There is an outstanding balance of $4,294 in Accounts Receivable. If you have the details handy you can send them over - realizing we're on our last mile here with the XXX XXXXXbooks!


Let us know if you have questions.Thanks!
Multiply Hub
Thank you for your trust.Multiply Client HubMultiply Website [sample@sampledomain.com]
Did you know you can text us anytime, day or night? 5 am on a Tuesday or 11:30 pm on a Saturday, we are here!###-###-####

Here’s the text that I WANT to be saved to airtable

Also, can we get on your schedule in the next week or so for a 30-60 minute meeting?

Thank you!

Doreen J. Van Ooyen

And Here’s the ones that I DON’T WANT

On Tue, May 28, 2024 at 8:35 AM Multiply Advisors <sample@sampledomain.com [sample@sampledomain.com]> wrote:
Good morning Joe - yes with the info we have now (well... that Doreen technically shared a while ago 😊) we should be able to work towards getting something pretty accurate by the end of the month. Let's say early next week we should have a P&L ready to share.
On May 28, 2024 at 8:29 AM, Joe Van OOyen (sample@sampledomain.com [sample@sampledomain.com]) wrote:Good morning, I would like to see if it’s possible by the end of this month that we could have everything we need to generate a P&L for Mentor Capital , South Carolina , And Mentor Capital Greenville. I’d like to be able to give them minority owners an update and then also show them exactly what we’re at


Thanks. Joe V

On Tue, May 28, 2024 at 7:55 AM Multiply Advisors <sample@sampledomain.com [sample@sampledomain.com]> wrote:Thanks Doreen.
We've attached the AAA Sewer P&L for 2024 and the Balance Sheet as of today - we'll likely need to do a bit of cleanup but otherwise yes we'll plan to send on the records as of 5/31.
On May 26, 2024 at 8:32 AM, Doreen Van Ooyen (sample@sampledomain.com [sample@sampledomain.com]) wrote:I would not be able to determine what the true A/R is in the company. I would suggest we reclass the balance in the A/R account and call it done. And then as of 5/31/24 we will close the books with Multiply and forward the records on to the partner. Thanks
Thank you!Doreen J. Van Ooyen

On Fri, May 24, 2024 at 7:54 AM Multiply Advisors <sample@sampledomain.comm [sample@sampledomain.com]> wrote:Hey Joe & Doreen,Please find attached the XXXX XXXX XXXXX and Loss Statement for XXXX XXXX
We'll need to make a few changes to the Mentor Capital SC report based on our discussion last night before that one's worth sending over!Key highlights include: * Revenue: $ XXXX
 * Expenses: $ XXXXX
 * Net Profit (Loss): ($ XXXX)

Three items that stood out this month: 1. The business experienced a sharp decline in revenue in April compared to March, with a minor reduction in labor costs and stable marketing expenses during the same period.
 2. Given the business's labor-intensive nature, it's practical to adjust staffing levels regularly in response to changes in workload or demand.
 3. This is not directly related to the Profit and Loss Statement, but it will impact financial performance: There is an outstanding balance of $4,294 in Accounts Receivable. If you have the details handy you can send them over - realizing we're on our last mile here with the XXX XXXXXbooks!


Let us know if you have questions.Thanks!
Multiply Hub
Thank you for your trust.Multiply Client HubMultiply Website [sample@sampledomain.com]
Did you know you can text us anytime, day or night? 5 am on a Tuesday or 11:30 pm on a Saturday, we are here!###-###-####

You can use a replace function to remove the quoted section of the email:

{{ replace(1.text; "/\s+On .+ at .+ [AP]M .+ wrote:[\w\W]+/"; emptystring) }}

https://regex101.com/r/8Fl3iW


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!

3 Likes

Thankyouuu for this! Quick follow-up question, how does one use/apply the replace function? What module should I use? Thank you!

You can put the function inline in the field where you want to map the email.

samliewrequest private consultation

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

1 Like

Hi! Tried this out and it still doesn’t work :< Does the RegEx code also work for any email that we’ll receive in the future?

It should work as long as the email format matches. How are you using it?

1 Like

The current setup is this:
We have an email inbox, every message received on that email is saved into airtable, that inbox receives multiple different emails from different people. So I don’t know if that messes up the regex (since multiple people have different ways in typing emails-also differs on what they are emailing us about)

And, this is how I use it.

I’ve shortened the regular expression pattern to

/\s+On.+at.+wrote:[\w\W]+/i

https://regex101.com/r/8Fl3iW/7

Hopefully it should match your email text now. Otherwise you need to provide the text that isn’t matching.

1 Like