cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nagoor
Helper II
Helper II

Refresh a gallery item where it shows the Sent mails from Outlook365

Dear Champs, 

 

I'm displaying the last 10 sent mail in gallery item, if new email is sent via, the gallery item is not updating with the new sent mails, still it showing old items. 

 

App Type : Canvas 

Using the below comments on Gallery Items

Item  = Office365Outlook.GetEmails({folderPath:"Sent Items", fetchOnlyUnread:false}) - Initial loading is working fine, but after the new mail, its not updating the gallery items. 

 

Is it possible to give any refresh button or auto refresh to gallery items. 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Anonymous
Not applicable

In your Gallery's Items property, use this:

 

If(RefreshOutlook,Blank(),Office365Outlook.GetEmailsV3({folderPath:"Sent Items", fetchOnlyUnread:false}).value)

 

Then, you can use this on a Button's OnSelect property:

 

Set(RefreshOutlook,true);
Set(RefreshOutlook,false);

 

 ---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

View solution in original post

Anonymous
Not applicable

You can use the Now() function since you're sending the email at that time.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-now-today-istoday

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

In your Gallery's Items property, use this:

 

If(RefreshOutlook,Blank(),Office365Outlook.GetEmailsV3({folderPath:"Sent Items", fetchOnlyUnread:false}).value)

 

Then, you can use this on a Button's OnSelect property:

 

Set(RefreshOutlook,true);
Set(RefreshOutlook,false);

 

 ---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

Hi, while using the formula i'm getting an error below. 

 

error.PNG

Anonymous
Not applicable

Have you added the Set() functions to a button yet? The RefreshOutlook variable doesn't technically exist until you do that, causing this error.

Oh Sorry..!! 

 

Its resolved.. 🙂

 

Do you have any idea how to capture the sent mail time into share point list.

 

 

Anonymous
Not applicable

You can use the recievedDateTime value from Office365Outlook.GetEmailsV3(). I noticed in my solution I didn't use V3 of the GetEmails function. please update your gallery Items code to this:

If(RefreshOutlook,Blank(),Office365Outlook.GetEmailsV3({folderPath:"Sent Items", fetchOnlyUnread:false}).value)

Just a small change, but it's always best to use the latest version.

You can use Patch() or Collect() to update or insert (respectively) to a SharePoint list. 

I have created an app to send a mail to people and store the data sent in SharePoint list, i have captured To, Subject and Message Body. I also want to get the sent time to store it in SharePoint List. 

 

I have used the below comments 

Office365Outlook.SendEmailV2(User().Email & "," & (TextSearchBox1_1.Text),TextEmailSubject1_1.Text , TextEmailMessage1_1.Text);
Patch(sharepoint_list,Defaults(sharepoint_list),{Subject: TextEmailSubject1_1.Text, Message: TextEmailMessage1_1.Text, To: TextSearchBox1_1.Text});

 

sent mail.PNG

Anonymous
Not applicable

You can use the Now() function since you're sending the email at that time.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-now-today-istoday

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

Thanks a lot..!!  🙏

 

Much appreciated your support..!

I have completed the works...😎 ✌️

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,733)