Simple problem to get messages from gmail

Hello friends,
I have a really simple problem that I can’t seem to solve.
I want to build a flow that checks my emails (10 at a time), extracts information from them, and saves it in Google Sheets.
The problem is that every time I run it, it gives me the same 10 emails instead of new ones.
I’d appreciate any help, thank you so much :folded_hands:t2:

1 Like

Hi @idogames8

Here’s how I like to do it.

Set up your workflow to get the max date of when you ran the workflow last (Store in google sheet)

Set the gmail node to pull only records after that date. you can even set it to extract all since there shouldn’t bee too many.

Then upcert into google sheet.

:heart:If this response helped you, please click the heart to show that it is useful
:white_check_mark:If this response solved your issue, mark it as the solution to help the community

hi,
I do have an issue, though since my inbox already has a lot of messages (8000+), I’d like to limit the workflow to pull only 10 messages at a time, without needing to use the max date value. Is that possible to set up?

1 Like

Hi @idogames8

There isn’t a way to sort by most recent in the gmail node. The best way to solve it is to filter to the last x days. Like this. Then upcert into your google sheet.

:white_check_mark:If this response solved your issue, mark it as the solution to help the community

@idogames8

For the initial load, you can loop through time ranges to import all 8k into google sheets.

:white_check_mark:If this response solved your issue, mark it as the solution to help the community

hello,
i try to did it like that:

so in the first time i will add 10 messages to the google sheet ,
and for the second i expect to get other (older) 10 messages but i got the same messages again.
so there are no solution for my issue?

thanks

1 Like

@idogames8

Use this workflow instead. I will loop through all of your messages bringing in 30 days of messages at a time. After you run this one, you can set the gmail node to only bring in the most recent day.

Hello
But as you told me, now you will bring all the messages from the last 30 days instead of just 10,

I think my problem may be a logical issue, or it cannot be solved.

1 Like

Hi @idogames8

Its not possible to do that with the gmail node. The best way to keep the number of records small is to filter by date. You can modify the workflow that I sent to do as small as 1 day increments. That should keep the data small enough to work with in n8n and google sheets.

:heart:If this response helped you, please click the heart to show that it is useful
:white_check_mark:If this response solved your issue, mark it as the solution to help the community

Hi @idogames8

Did the answer solve your question?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.