cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
beniwal
Helper III
Helper III

office365.move method

Hi,

 

I want to move an email to a different folder through powerapps.

 

Please guide how to use the office365.move function !

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @beniwal ,

Do you want to remove a Outlook email from default Inbox folder into another different folder?

 

Before you remove a Outlook email from default Inbox folder into another different folder, you need to find the specific email from your Outlook Inbox firstly.

 

I have made a test on my side, please take a try with the following workaround:5.JPG

 

6.JPG

 

7.JPG

Set the OnStart property of the App control to following:

ClearCollect(EmailCollections, Office365.GetEmails({folderPath: "Inbox", top:25}))

Note: Currently, there is an known limit with Office365.GetEmails() function or Office365.GetEmailsV2() function -- we could only retrieve 25 emails at most once time.

Add a Gallery control in your app, set the Items property to following:

EmailCollections

within the Gallery, add a "Move" icon, set the OnSelect property to following:

Office365.MoveV2(ThisItem.Id, "Junk Email");  /* <-- "Junk Email" represents the Outlook folder you want to move email to */
ClearCollect(EmailCollections, Office365.GetEmails({folderPath: "Inbox", top:25}))

If you want to move an email to an Subfolder of an specific Outlook, please modify above formula as below:

Office365.MoveV2(ThisItem.Id, "Root Folder/Sub Folder");
ClearCollect(EmailCollections, Office365.GetEmails({folderPath: "Inbox", top:25}))

Please check the following GIF screenshot for more details:Test.gif

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
yashag2255
Dual Super User II
Dual Super User II

Hi @beniwal 

 

You can use the below command for achieving this:
 
Office365.MoveV2(ThisItem.Id,"Sent Items")
 
Here, as first argument of the function, you need to pass the unique message id to identify the email. Since, I have used a gallery control to display a number of emails, so I have used ThisItem.Id to get the ID for specific email. Second argument need to be the folder name you want to move in the mails to.
III1.png

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

v-xida-msft
Community Support
Community Support

Hi @beniwal ,

Do you want to remove a Outlook email from default Inbox folder into another different folder?

 

Before you remove a Outlook email from default Inbox folder into another different folder, you need to find the specific email from your Outlook Inbox firstly.

 

I have made a test on my side, please take a try with the following workaround:5.JPG

 

6.JPG

 

7.JPG

Set the OnStart property of the App control to following:

ClearCollect(EmailCollections, Office365.GetEmails({folderPath: "Inbox", top:25}))

Note: Currently, there is an known limit with Office365.GetEmails() function or Office365.GetEmailsV2() function -- we could only retrieve 25 emails at most once time.

Add a Gallery control in your app, set the Items property to following:

EmailCollections

within the Gallery, add a "Move" icon, set the OnSelect property to following:

Office365.MoveV2(ThisItem.Id, "Junk Email");  /* <-- "Junk Email" represents the Outlook folder you want to move email to */
ClearCollect(EmailCollections, Office365.GetEmails({folderPath: "Inbox", top:25}))

If you want to move an email to an Subfolder of an specific Outlook, please modify above formula as below:

Office365.MoveV2(ThisItem.Id, "Root Folder/Sub Folder");
ClearCollect(EmailCollections, Office365.GetEmails({folderPath: "Inbox", top:25}))

Please check the following GIF screenshot for more details:Test.gif

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,153)