cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jhardwick
Frequent Visitor

Move Email (V2) dynamic supplied folder name

I'm working on a flow to do some dynamic logic to determine the appropriate folder to file an email in within Outlook.  I'm running into a problem supplying the folder parameter to the Move Email (v2) programmatically. 

 

From looking at the peak code piece after using the selector is the action expecting that folder name to be provided via a GUID rather than a humanly readable path/folder name?  If so, is there any way to determine that programmatically by supplying a human-readable name to lookup the GUID in the flow?

1 ACCEPTED SOLUTION

Accepted Solutions
fchopo
Super User
Super User

Hello @jhardwick 

I'm not sure I understand your problem, but in any case, I attach an example flow that is working, where I move an email to the drafts folder:

emails.png

 As you can see, the drafts folder is set in a compose action, so it's a dynamic value in the "Move email" action.

Hope it helps!
Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

8 REPLIES 8
fchopo
Super User
Super User

Hello @jhardwick 

I'm not sure I understand your problem, but in any case, I attach an example flow that is working, where I move an email to the drafts folder:

emails.png

 As you can see, the drafts folder is set in a compose action, so it's a dynamic value in the "Move email" action.

Hope it helps!
Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

jhardwick
Frequent Visitor

@fchopo you know you reach the point where you've looked at a problem for too long and need to stop and pick it up later, yep.. I was at that point.

 

My issue was that I was trying to reference a subfolder under Inbox and I had been using the format of Inbox\Subfolder instead of Inbox/Subfolder and I didn't think of trying that until reading your response and looking at things again.

 

Regards

heinsthorbenguj
Frequent Visitor

Hi! I just found your thread and it looks like my exact problem. So you made it work using the the suggestion with the "Compose" action and it also worked for sub folders? I am trying to get this working with a shared mailbox. 

MichelH
Advocate V
Advocate V

Keen to know if this works on subfolders a level deeper.

I need to move mails to:
Inbox/Subfolder/New
Inbox/Subfolder/Ongoing
Inbox/Subfolder/Done

Where Subfolder would be a variable with one of 8 choices.

Thanks for any feedback

Br,
Michel

heinsthorbenguj
Frequent Visitor

Hi Michael,

i ended up using the internal "FolderId"s. You can obtain them in the requests when using the test button in the browser console. Putting them into the "folder" field works. 

MichelH
Advocate V
Advocate V

Thank you Heins,

 

Not sure that I understand what you mean on how to obtain these folderId's. 

Am I correct that you copy these kind of keys? I see this using Peek code.

 

"parameters": {
"messageId": "@items('Apply_to_each_4')?['id']",
"folderPath": "Id::AAmKADMwNGU2zwE1LTFhZmEtNDMwMi04MmYwLThkOWYzMDA3ZjAwNgAuAAAAAABPl25eHUXgQqEdUbfVS5B8AQDD2FumZE_RTopraV1GiPOqAAACosOLAAA="
},
"authentication": "@parameters('$authentication')"
},
"metadata": {

"Id::AAmKADMwNGU2zwE1LTFhZmEtNDMwMi04MmYwLThkOWYzMDA3ZjAwNgAuAAAAAABPl25eHUXgQqEdUbfVS5B8AQDD2FumZE_RTopraV1GiPOqAAABQ_hTAAA=": "New",

"Id::AAmKADMwNGU2zwE1LTFhZmEtNDMwMi04MmYwLThkOWYzMDA3ZjAwNgAuAAAAAABPl25eHUXgQqEdUbfVS5B8AQDD2FumZE_RTopraV1GiPOqAAACosOLAAA=": "Ongoing"

   
Because to me they seem like:   Mailbox + "_" + MsgID, but not the FolderID. 

 

The folderpath is equal to the second Id.

 

Br,

Michel

heinsthorbenguj
Frequent Visitor

Correct.

MichelH
Advocate V
Advocate V

But the second ID is generated only when the move is done.

I don't yet know the new message ID when I want to do the move, from New to Ongoing.

I'm moving a new message every time.

I think I'm missing the point?

 

Br,

Michel

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,698)