cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kylep
Level: Powered On

Cannot use Quotes in Search Query for Office 365 Get Emails

We're trying to search Office 365 emails from last week.  The below query works in OWA, but gives an error in Flow.

(received:"last week")

status: 400

Syntax error: character '"' is not valid at position 22 in '"(received:'"last week"')

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Cannot use Quotes in Search Query for Office 365 Get Emails

Hi @kylep ,

It seems you want to get the emils which are received last week.

I have made a test with the received:last week in the Search Query field.

However the output is [].

Capture3.PNG
I suggest you use the ‘Filter array’ here.
The expression in Compose is: dayOfWeek(utcNow())

dayOfWeek

Return the day of the week from a timestamp.

The expression in 'Filter array' is to get the last sunday: 

addDays(utcNow(),sub(0,outputs('Compose')),'yyyy-MM-dd')
4.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 REPLIES 3
Highlighted
Super User
Super User

Re: Cannot use Quotes in Search Query for Office 365 Get Emails

The syntax for Flow is different.  In your Search Query of your O365 Get Emails Action use this instead:  received:last week

 

See the attached screenshot for reference.  That should return emails received last week.EmailsLastWeek.png

kylep
Level: Powered On

Re: Cannot use Quotes in Search Query for Office 365 Get Emails

@aprildunnam Thanks for the reply, but that didn't work.  It's runs successfully but doesn't pull any data without the quotes.  Below is the full search query.

 

(received:"last week")AND(from:email@domain.com)

Community Support Team
Community Support Team

Re: Cannot use Quotes in Search Query for Office 365 Get Emails

Hi @kylep ,

It seems you want to get the emils which are received last week.

I have made a test with the received:last week in the Search Query field.

However the output is [].

Capture3.PNG
I suggest you use the ‘Filter array’ here.
The expression in Compose is: dayOfWeek(utcNow())

dayOfWeek

Return the day of the week from a timestamp.

The expression in 'Filter array' is to get the last sunday: 

addDays(utcNow(),sub(0,outputs('Compose')),'yyyy-MM-dd')
4.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

>