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

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
EricLott
Level 10

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

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

EricLott
Level 10

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

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
EricLott
Level 10

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

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

nagoor
Level: Powered On

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

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

 

error.PNG

EricLott
Level 10

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

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

nagoor
Level: Powered On

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

Oh Sorry..!! 

 

Its resolved.. 🙂

 

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

 

 

EricLott
Level 10

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

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. 

nagoor
Level: Powered On

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

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

EricLott
Level 10

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

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

nagoor
Level: Powered On

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

Thanks a lot..!!  🙏

 

Much appreciated your support..!

I have completed the works...😎 ✌️

Helpful resources

Announcements
thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,704)