Skip to content
How to only process...
 
Notifications
Clear all

How to only process the latest email, ignoring the rest of the chain

10 Posts
2 Users
0 Reactions
3 Views
Musngi_Junariez
(@musngi_junariez)
Posts: 5
Active Member
Topic starter
 

Hello everyone, hope you're having a great day! I'm encountering a bit of a challenge.

I have an automation set up involving three applications: Missive → callin.io → Airtable.

My process starts with a 'Watch New Message' trigger for Missive to capture the message ID of new emails. This ID is then used in an API call to retrieve the entire email body, which is subsequently saved to Airtable.

My issue is that when emails arrive, the entire conversation thread is being saved to Airtable. Is there a method to filter out the older emails in the chain and only retain the most recent one?

Screenshot of callin.io Scenario

Screenshot of current output

The messages enclosed in the blue box represent the content I wish to save. Those within the red box are the preceding emails in the thread that I want to exclude.

Thank you for your assistance!

 
Posted : 29/05/2024 4:58 am
samliew
(@samliew)
Posts: 293
Reputable Member
 

You will need to utilize a Text Parser Match Pattern module or a replace function to identify or remove any content you wish to keep or discard.

If you require additional assistance, please furnish the following:

When seeking help with your regex pattern for a Text Parser module, it would be highly beneficial if you could share the exact text you are attempting to match. Screenshots of text can present challenges, so if you could copy and paste the text directly here, that would be greatly appreciated! This allows us to test patterns against it effectively. If there is any sensitive information, feel free to substitute it with fictional yet valid data by maintaining the original format.

Providing clear text examples expedites the process for everyone involved and helps us deliver the most effective solution. Without proper examples, we might resort to guesswork, which is an inefficient use of time! You are more likely to receive a correct answer quickly. Therefore, assist us in helping you by sharing those text snippets.

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

    ```
    text goes here
    ```

  • Alternatively, use the format code button within the editor:
    Screenshot_2023-10-02_191027

Join the unofficial callin.io Discord server to connect with other makers!

 
Posted : 29/05/2024 5:16 am
Musngi_Junariez
(@musngi_junariez)
Posts: 5
Active Member
Topic starter
 

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!###-###-####
 
Posted : 29/05/2024 5:36 am
samliew
(@samliew)
Posts: 293
Reputable Member
 

You can utilize a replace function to remove the quoted section from the email:

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

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


For further details, consult the Text Parser documentation in the callin.io Help Center:

Match Pattern
The Match pattern module allows you to locate and extract string elements that correspond to a search pattern within a given text. The search pattern is a regular expression (also known as regex or regexp), which is a sequence of characters where each character is either a metacharacter, possessing a special meaning, or a regular character with a literal meaning.

Hope this assists you!

 
Posted : 29/05/2024 6:15 am
Musngi_Junariez
(@musngi_junariez)
Posts: 5
Active Member
Topic starter
 

Thank you for this! Quick follow-up question: how does one use or apply the replace function? Which module should I use? Thank you!

 
Posted : 29/05/2024 6:47 am
samliew
(@samliew)
Posts: 293
Reputable Member
 

You can place the function directly within the field where you intend to map the email.

request private consultation

Join the unofficial callin.io Discord server to connect with other users!

 
Posted : 29/05/2024 7:26 am
Musngi_Junariez
(@musngi_junariez)
Posts: 5
Active Member
Topic starter
 

Hi! I tried this out, and it still doesn't seem to be working :< Does the RegEx code also apply to any future emails we might receive?

 
Posted : 29/05/2024 9:21 am
samliew
(@samliew)
Posts: 293
Reputable Member
 

It should function correctly provided the email format aligns. Could you describe how you are implementing it?

 
Posted : 29/05/2024 10:25 am
Musngi_Junariez
(@musngi_junariez)
Posts: 5
Active Member
Topic starter
 

Here's the current setup:
We have an email inbox, and every message received is saved into Airtable. This inbox handles multiple emails from different senders. Therefore, I'm unsure if this might affect the regex, given that various individuals have distinct ways of typing emails and also differ in their subject matter.

And, this is how I'm utilizing it.

 
Posted : 29/05/2024 11:12 am
samliew
(@samliew)
Posts: 293
Reputable Member
 

I've simplified the regular expression pattern to:

/s+On.+at.+wrote:[wW]+/i

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

Hopefully, this will now match your email text. If not, please provide the text that isn't matching.

 
Posted : 29/05/2024 11:30 am
Share: