SharePoint and Power Automate

PowerAutomate and LegalServer's SharePoint Integration Converting to DOCX via PowerAutomate

One benefit of SharePoint is the ability to add in other aspects of the Microsoft suite of tools. PowerAutomate is utilized in the examples below as tested in December 2022. LegalServer is not a Microsoft partner nor a consultant in how to use Microsoft tools. Microsoft's products change over time so these examples may not be a perfect match to Power Automate if you go to set them up. LegalServer strongly recommends testing these on your Demo Site and Library first before enabling on your Live site and SharePoint Library. 

Please realize that creating Flows in Power Automate is done on a site/library basis, so you may need to have multiple copies for multiple libraries. There may also be rate limits and activation caps to consider given larger volumes. PowerAutomate does not scan for updates immediately, so there may be a few minute delay between the trigger from LegalServer and the action from PowerAutomate. 

Creating Subfolders via PowerAutomate

For example, a PowerAutomate Flow could be set up to automatically create subfolders for a case once the initial case folder has been created by LegalServer.

The above example creates a subfolder named "documents" in any folder created at the root level of the SharePoint Library named "RTFtoDOC". It only happens at that level and not to subfolders. The Create new folder action could be repeated for additional folders as well.

Convert RTF to DOCX

Another (and unfortunately more complex) option is converting a file to Docx via PowerAutomate. Due to the nature of the files, you cannot automatically go from RTF to DOCX directly, even with Microsoft's tools. Microsoft does allow you to convert from RTF to DOC. Once in a DOC file, there is an option to convert to DOCX from within Word Online. The following Flow would convert the file to the same name, save it in the same directory, and then delete the RTF file. That last step may be useful if you are only getting RTF files from LegalServer Templates. If you are getting RTF files elsewhere, you may want to add additional Condition steps or remove it completely. DO NOT IMPLEMENT THIS LAST STEP IF YOU DO NOT WANT TO DELETE FILES.

On the first step, you can narrow the Flow's focus to just RTF files by using the menu to open the settings for the step. Then under Trigger Conditions add: 

@endsWith(triggerOutputs()?['body/{FilenameWithExtension}'],'rtf')

Once you have the new DOC file, opening it will give you the option to convert to DOCX in Word Online. Converting to DOCX will then leave you with two copies of the file. If you don't want to have that interim DOC file (and are not concerned about other DOC files being converted to DOCX that did not start as LegalServer Templates), you can add a second flow to remove the interim DOC file.

Note that the first step would have a Trigger Condition like above but specifying "docx" instead of "rtf". Then the second step uses dynamic content from the first step, while the third step uses dynamic content from the second (and not from the first).

Again, these Flows may delete the original versions of your documents. If that is a concern, DO NOT IMPLEMENT THEM. Consider additional Conditions or limits on them. Perhaps they only run in certain subfolders or there is a way to mark a file to prevent removal. 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us