Skip to main content

Notifications

Community site session details

Community site session details

Session Id : bWERx+j0caLBQt6nWEHQDx
Power Apps - Building Power Apps
Answered

Get flagged emails only

Like (0) ShareShare
ReportReport
Posted on 18 May 2020 14:54:18 by 914

Hi all!
I need to show a list of all flagged emails, which works for some users but not for others.

 

I have tried using both GetEmailsV2 & V3. For myself it works brilliantly, but not for a colleague using the app; he gets no email at all even if he does indeed have flagged emails.

 

I have set a data table's Items-property to:

Office365Outlook.GetEmailsV3({fetchOnlyFlagged:true}).value

 

As I wrote, it works very well for me but not for a colleague - why and what can I do to remedy it?

 

Thanks in advance!

Categories:
  • Verified answer
    BitLord69 Profile Picture
    914 on 29 May 2020 at 14:51:37
    Re: Get flagged emails only

    I think we found the "problem": when getting flagged messages it retrieves unread messages only! To get flagged messages that also have been read, you have to specify the fetchOnlyUnread:false as well.

     

    It would be a great idea to update the documentation with this information!!!!!

  • BitLord69 Profile Picture
    914 on 26 May 2020 at 06:31:10
    Re: Get flagged emails only

    The whole point of the question is: it does not work!  I get zero (0) messages back for some users, even if they have flagged messages.

     

    Since it works for me, is there some sort of setting in the mail box they have done that stops the function to work properly? I've read the documentation several times, and there is nothing in it about cases like this.

  • v-xida-msft Profile Picture
    on 21 May 2020 at 02:31:31
    Re: Get flagged emails only

    Hi @BitLord69 ,

    The Office365Outlook.GetEmailsV3() function currently could only retrieve 25 emails at most once time. In other words, if there are 50 Flagged emails in your Mailbox, this function could only retrieve first 25 emails (You could specify search query within this function to get the latest 25 Flagged emails).

     

    If you would like this feature to be improved in PowerApps, please submit an idea to PowerApps Ideas Forum:

    https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

     

    Best regards,

  • BitLord69 Profile Picture
    914 on 20 May 2020 at 06:23:24
    Re: Get flagged emails only

    I want to get *only* flagged messages, so what about limitations for that?

  • v-xida-msft Profile Picture
    on 20 May 2020 at 02:34:52
    Re: Get flagged emails only

    Hi @BitLord69 ,

    Currently, there are some known limits with Office 365 Outlook connector, if you want to search all messages within your mailbox, and filter these emails matching the specific criteria, I afraid that the Office 365 Outlook connector could not achieve your needs.

     

    Best regards,

  • BitLord69 Profile Picture
    914 on 19 May 2020 at 13:57:13
    Re: Get flagged emails only

    Hi again,

     

    I tried this, as per your suggestion:

    Office365Outlook.GetEmailsV3({fetchOnlyFlagged:true, top:25, searchQuery:"$orderby=received desc"}).value

     

    but my colleague says it still does't work for him. He probably has more than 25 flagged messges in his inbox, but shouldn't your suggestion work anyway?

     

    We will try with two beta testers tomorrow, so will see how it works for them.

     

    Thanks!

     

  • v-xida-msft Profile Picture
    on 19 May 2020 at 07:35:15
    Re: Get flagged emails only

    Hi @BitLord69 ,

    Currently, there is an known limit with the Office365Outlook.GetEmailsV3() function -- It could only return 25 emails at most once time.

    If you specify a number value more than 25 for the top attribute, the following error message would show up:

    6.JPG

     

    How many Flagged emails existed in your end user's mailbox? More than 25? If there are more than 25 Flagged emails existed in your end user's mail box, I afraid that there is no way to achieve your needs.

     

    The "fetchOnlyFlagged" attribute is not applied to the "first 250 limits", it could only retrieve 25 emails at most once time. If you want to retrieve the latest 25 Flagged emails, please modify your formula as below:

    Office365Outlook.GetEmailsV3({fetchOnlyFlagged:true, top:25, searchQuery:"$orderby=received desc"}).value

     

    Best regards,

  • BitLord69 Profile Picture
    914 on 19 May 2020 at 07:04:58
    Re: Get flagged emails only

    Hi Kris!

     

    Thanks for your reply.  

     

    The other user have the same mail box, he has signed in and accepted the different connectors when he started to use the app. There is no error message at all when trying to see flagged emails.

     

    Furthermore, in the app one can also choose to look at calendar events, not yet completed tasks and planner plans/buckets/tasks. All of these things my colleague can access and see; it's only flagged mail that won't dance.

     

    In the article you reference, they write:


    This operation gets emails from a folder via graph apis. Please note that filtering related to these fields: To, Cc, To Or Cc, From, Importance, Fetch Only With Attachments, Subject Filter, is performed using first 250 items in a given mail folder. To avoid that limitation you can use 'Search Query' field.

     

    Could that be the reason? What does the first 250 items mean? Does it sort the mails by date, ascending or descending? My colleague certainly has more than 250 mails in his inbox, so maybe that is why. 

     

    They recommend to use the seach query, but as I understand it, you cannot get flagged messages that way.

     

    Looking forward to hear more from you.

     

    Jan-Erik Karlsson

  • v-xida-msft Profile Picture
    on 19 May 2020 at 03:35:29
    Re: Get flagged emails only

    Hi @BitLord69 ,

    Are there some error messages occurred when your end users run the Office365Outlook.GetEmailsV3() function on their side?

    Do these end users own same Office 365 license as you for accessing Outlook connector from canvas app?

     

    I have made a test on my side, and don't have the issue that you mentioned. Firstly, please make sure your end users have enabled  REST API feature for their Office 365 Mailbox.

    There are some known limits with Office 365 Outlook connector in PowerApps, please check the following article:

    https://docs.microsoft.com/en-us/connectors/office365/#known-issues-and-limitations

     

    Also please make sure your end users have owned proper Office 365 license to use Office 365 Outlook connector in canvas app (same with you at least).

     

    In addition, also please make sure they have owned proper PowerApps license for accessing PowerApps canvas app you shared to them.

    Note: When your end user to access your shared canvas app, he would be prompted to provide their own credential to create connection to Office 365 Outlook connected used in your shared app. Please make sure your colleague provide his own proper credential to create a connection to the Office 365 Outlook connector used in your app

     

    Best regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
MS.Ragavendar Profile Picture

MS.Ragavendar 27

#2
mmbr1606 Profile Picture

mmbr1606 14 Super User 2025 Season 1

#3
EE-04041031-0 Profile Picture

EE-04041031-0 11

Overall leaderboard
Loading started