An Alternate Method to Using the MuleSoft Sharepoint Connector – RPA and Power Automate! (Part 2)

Overview – Using an Alternate to the MuleSoft Sharepoint Connector

In several of my previous blog posts (RPA Introduction, Iterate over HTML, Web Form Filling, and others), we learned that the MuleSoft RPA processes can be used to handle a plethora of use cases and these processes can be triggered from all sorts of common applications. This post shows how easily a MuleSoft RPA process can be used to work with Sharepoint data. The use case kicks off a published RPA process, triggered by the creation or upload of a new file in a specific Sharepoint folder. The RPA process receives the name of the file, downloads the file, parses the data, and uses the parsed data to do swivel-chair operations updating another application (Salesforce). Whereas Part 1 focused on the Sharepoint side of this integration, this Part 2 post focuses on the MuleSoft RPA Builder side.  Follow along as we show you this alternate method of getting things done without using the MuleSoft Sharepoint Connector

This use case implementation has 4 workflows:

  • Download a CSV from Sharepoint
  • Log in to Salesforce
  • Create a Quote from CSV
  • Add Products to the Quote

Diagram of the implementation of the MuleSoft RPA workflow

The key aspects this post will focus on are:

  • Downloading the file from Sharepoint without logging in to Sharepoint at each RPA process run
  • Find the downloaded file
  • Parse useful data from the downloaded file

Important Callout

It is important to note that this setup is not the only way to integrate with Sharepoint; this is to specifically show how to directly integrate Sharepoint with a MuleSoft RPA process. However, for organizations with Anypoint Platform subscriptions, a MuleSoft application can be used to easily monitor and/or integrate with Sharepoint using the robust MuleSoft Sharepoint Connector. The connector has dozens of operations available to handle Sharepoint integration needs, and MuleSoft’s integration platform enables all sorts of processing and orchestration options.

Key Aspects of MuleSoft RPA Sharepoint Integration

How to Download Sharepoint File without Login

This use case shows how to configure the RPA process to download the file from Sharepoint without logging into Sharepoint at each run. To do this, manually log into the PC/VM as the Windows user that the RPA bot runs as. With that user, open Chrome and log into Sharepoint. Ensure that the login persists; close Chrome and reopen and make sure it is still logged in to Sharepoint. If it is, that login info is stored in that user’s Chrome user data. With that in place, open the Chrome Web Session configuration and add an “Additional argument”. Set –user-data-dir=C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data. This will have the RPA process use the bot user’s Chrome user data which will include the Sharepoint login. This will save the RPA developer from needing to configure the RPA process to log in to Sharepoint each time the process runs:

Web Session Wizard setup for downloading file

How to Find Downloaded File

After the process navigates to the URL (<sharepointBaseURL>/<sharepointFileName>), Chrome automatically downloads the file to C:\Users\%USERNAME%\Downloads. The file can then be found in that downloads directory with the file name represented by sharepointFileName:

Set file download location property

Wizard screen for Read from text File property setup

How to Parse the Data from Downloaded File

To parse the data from the file, get the number of lines in the file. Loop over those lines one by one, and convert each CSV line into an array of values (e.g. productName and listPrice in the example screenshot). These values can be used in later steps to do data entry into the target system:

Configure Loop steps to parse text file

Putting the Alternate Method to Using the MuleSoft Sharepoint Connector All Together

To see this in action, and learn more details about this alternate method to the MuleSoft Sharepoint Connector, check out the video that goes along with this post:

After reading the blogs and watching the videos, it will be clear how straightforward it is to automate Sharepoint interactions with other organizational applications using MuleSoft RPA.


Talk to the Professionals!

To learn more about our MuleSoft RPA, MuleSoft and EDI, or Salesforce services, please visit our website or fill out a Contact Us form here.

CloudFirst Labs logo