File operations Using Sharepoint connector in Mule 4

 

In this tutorial we will demonstrate how can we perform file operations using sharepoint connector in mule 4

Microsoft SharePoint Connector supports both SharePoint 2013 and SharePoint Online for the use in the cloud and on-premises. This connector used to manage content and document management, you can perform multiple operation with sharepoint like fileupload,create folder,file read, file checkin etc.

Prerequisite:

  1. Should have access to Microsoft sharepoint
  2. Sharepoint connector should be available in palette(Kindly add the sharepoint if not present in mule palette)

File Upload

Here we will read the file from a local directory and upload the CSV file to sharepoint using File add operation of sharepoint connector

Create a project in anypoint studio and configure the listener to trigger the request

 

 

Configure the sharepoint connection(Please visit last tutorial see the steps to register on sharepoint and get the credentials)

 

Configure the server relative url and File Content as payload as data which is to upload on sharepoint

 

Create the message to send back to client

 

Deploy the project and trigger from SOAPUI

 

We can see file uploaded successfully to sharepoint

 

 

File Get Content

Here we will read the CSV file data using file get content operation of mule sharepoint connector

Drag and drop the File get content operation from mule palette

Configure the connection details

File operations Using Sharepoint Connector In Mule 4

 

Provide the server relative url

File operations Using Sharepoint Connector In Mule 4

 

Deploy the project and trigger the request from soapui

File operations Using Sharepoint Connector In Mule 4

 

Logger data printed

File operations Using Sharepoint Connector In Mule 4

Sample Project:  sharepoint connector

  
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
 
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.


Share this:
Subscribe
Notify of
guest
4 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Myna Trip
Myna Trip
1 year ago

Great Article and very useful. I was able to follow your steps and configure my connection to sharepoint online. However, I’m getting a “Unable to obtain access token”. Any ideas as to what might be causing this? I changed password to an incorrect one and it returns “invalid credentials”. So, I know it’s not the credentials.

Ásta
Ásta
1 year ago

Hi, thank you for all these useful demos. I was wondering if you have tried the sharepoint connector for child sites? That is e.g. mulesy.sharepoint.com/myTeam/Shared Documents/Records/Sample.csv

Bharath Kumar B R
Bharath Kumar B R
1 year ago

please post an example of on modified objects

Bathini
Bathini
11 months ago

Hello Mulesy,

I am trying to “file get content” from sharepoint by following above steps. But, I am getting below error.

ERROR:
org.mule.runtime.core.api.expression.ExpressionRuntimeException: “Script ‘ ‘ has errors: 
Missing Body Expression. i.e dw 2.0
 — 
 true at 1 : 1″ evaluating expression: ”

Please advise.