Faculty, staff, and students can utilize Power Automate in order to automatically save incoming email attachments sent from their scanner into their SharePoint site. Power Automate exists in the same Microsoft ecosystem as SharePoint and OneDrive.
Note |
---|
This process cannot be used with HIPPA data. Be cautious when using this method with other PII. |
What will this automation do?
...
Click on the text Apply to each Attachment on the email to expand the box. Then click on Create file to expand that box.
Click on the Site Address field to see a list of your SharePoint sites.
Note: If you do not see your site, you may open a new browser tab and navigate to s.uconn.edu/sharepoint to visit your SharePoint site there. Then simply copy the URL from the address bar and paste it into this field.
Once you have the SharePoint site field filled in, you need to choose the folder in which you want the scans to be deposited.
This folder will be the repository for all of your scans.
Like you did with Inbox above, click on the folder icon and then choose the arrow next to Shared Documents to open that location.
Clicking on the folder name will select that folder while clicking on the arrow will open the folder.
The next two fields, File Name and File Content should be left as-is.
Tip |
---|
The scans need this crafted name to ensure the automation runs correctly. The resulting PDFs can be renamed once they appear in SharePoint. |
Expand |
---|
title | If you would like to learn more about the File Name and File Content fields, click here: |
---|
|
Info |
---|
The following steps will show you how to recreate what was included in the template. |
The File Name field allows you to set the file name of the incoming scan. If you set a static name, each new scan will overwrite the last. To avoid this, you need a way to assign a unique file name to each new scan. To achieve this, the template you downloaded appends a timestamp to the filename: “Scan-[time of scan][random number].pdf” The time-of-scan random number will be the unique identifier that prevents the over-writing of files. Click on the File Name field and clear it out. When you click on the field, a popup window will appear: click on the Expression tab of this window. Copy and paste the following text into the textbox: formatDateTime(addHours(utcNow(), -4),'yyyy-MM-ddTHH:mm:ssZ') Then click Update. The dynamic text is now in the field. Now you will need to add the safety net. You will use a pseudo-random number generator for this. Click on the File Name field again, a popup window will appear. Click on the Expression tab of this window. Type in rand(0,999) . This will append a random number between 0 and 999 to the file name. You may change this range if desired. This is necessary due to how Microsoft handles the timecode. The time represented in the file name is not when the scan is created, but rather when Microsoft runs the automation. From testing, it appears that Microsoft handles the automations either in batches or handles many of them in less than a second. Either way, the result is multiple scans may have the same value in the seconds-field, and therefore multiple scans are created with the same filename and the next automations in that “batch” will fail to run. Image Added
You need to add .pdf to the end of the name to maintain file integrity. Place your cursor at the front to add some static text if desired. Adding “Scan” will help you in using the search to find these files. You may need to use your arrow keys to get the cursor to the front of the box. You need to add .pdf to the end of the name to maintain file integrity. Image Removed- Image Added
Leave the File Content field as it is. Changing this may corrupt the resulting file. If you need to add the dynamic text, click on the field and search in Dynamic content for “Attachments Content” Image RemovedImage Added
Final result: Image RemovedImage Added
|
Action 2
Info |
---|
You can remove this Action if you do not want the email to be automatically deleted. |
...