![how to save emails to computer aplus how to save emails to computer aplus](https://i.ytimg.com/vi/gFY2RY-wOsw/maxresdefault.jpg)
#How to save emails to computer aplus how to
I’ve two actions here, one to demonstrate how to save to a custom dynamic path, the other to a custom dynamic site. You can accept the default Power Automate build if you would prefer. For my solution, I am a stickler for efficiency and have used the first() expression described previously as my Xerox will only ever include one file. You can accept this and your solution will handle multiple attachments. Why? This is because the results for the attachment name and content are returned as an array. By default, when you select these dynamic values, Power Automate will put your actions into an Apply to Each. Using the Create File action for SharePoint, I am using the Attachments Name and Attachments Content dynamic expressions from the email trigger. Using First() or calling the element by using an integer will allow you to simplify your Flow if you know the result will always be the first element. Calling the path without either using the first expression or body(‘FilterFindPath’)? to select the first element, you will receive an error “ Array elements can only be selected using an integer index“. Why do I use the first expression? Because the result is returned as an array, it expects multiple elements. Here I use a compose action to return the first object from the array result. If we get a match, the array will return a value for the Path. We must now use the filter array action, which will allow us to search the Subject or Attachment name to see if it contains one of the keywords from the Dept key. If you are looking to have a dynamic Folder and Site, you can define a third parament or key:value pair. The parameters for this flow are basic, a keyword for searching the Subject or Filename containing, which I have called Dept and the Path, which can either be a folder or a Site Name.