This gem runs in .
Overview
Use a Source or Target gem to read from or write to SharePoint in Prophecy pipelines. This page covers supported file formats, how to create the gem, and how to configure connection details and paths for both Source and Target gems.Supported file formats
Add a SharePoint Source or Target gem
To add a SharePoint Source or Target gem to your pipeline:1
Add a Source or Target gem to the pipeline
- Open your pipeline in Studio.
- Click Source/Target in the canvas.
- Select Source or Target from the dropdown.
- Click the gem to configure it.
2
Select SharePoint format
In the Type tab, select SharePoint. Click Next.
3
Set location details
In the Location tab, set your file format and connection details. To learn more, see Location below.
4
Set file properties
In the Properties tab, set file properties. These vary based on the file type that you are working with.
See the list of properties per file type, such as CSV.
5
Preview data (Source only)
In the Preview tab, load a sample of the data and verify that it looks correct.
Grant service principal access to SharePoint sites
The connection you select or create in the Location tab authenticates to SharePoint as a service principal (an Azure AD app registration). Before that connection can read from or write to a site, the service principal needs explicit access to it. Microsoft recommends theSites.Selected permission over tenant-wide access, since it scopes the service principal to specific site collections only.
Prerequisites
- An Azure AD app registration to use as the service principal.
- SharePoint Administrator or Global Administrator role on the tenant.
- Access to Microsoft Graph Explorer.
1
Add the Sites.Selected permission
- In the Azure Portal, go to App Registrations and select your app.
- Click API permissions in the left menu.
- Click Add a permission > Microsoft Graph > Application permissions.
- Search for and add
Sites.Selected. - Click Grant admin consent for your tenant.
2
Get the SharePoint site ID
Use Graph Explorer to look up the ID of the site you want to grant access to.For example:
- Go to Graph Explorer and sign in with a SharePoint Administrator or Global Administrator account.
- Take the site’s normal URL (for example,
https://prophecy.sharepoint.com/sites/testsite) and convert it to the Graph format: replace the first/after the hostname with a colon. - Set the method to
GETand run:
- Copy the
idvalue from the response. This is the site ID used in the next step.
3
Grant access to the site
Use a
POST request to assign the service principal a role on the specific site.- In Graph Explorer, set the method to
POSTand use the site ID from Step 2:
- In the Request body tab, paste the following, replacing
<app-client-id>and<app-client-id>with your service principal’s values:
- Click Run query. A
201 Createdresponse confirms the permission was granted.
Grant both
read and write together, as shown above. This is the only combination Prophecy has tested; granting read alone for Source-only connections is untested and not currently recommended.Troubleshooting
403 Forbidden when running the POST request
Confirm you’re signed in to Graph Explorer as a SharePoint Administrator or Global Administrator. In Graph Explorer, open Modify permissions and consent toSites.FullControl.All, then re-run the request.
Invalid hostname error
Make sure that you have a colon: before /sites in the hostname.
Correct: prophecy.sharepoint.com:/sites/testsite (uses colon before /sites/)
Wrong: prophecy.sharepoint.com/sites/testsite (uses slash)
Permissions don’t seem to take effect**
Sites.Selectedgrants nothing by default; you need to grant access per site explicitly via Step 3.- Confirm Step 3 was repeated for each site the connection needs, not just the first one.
- Permission grants can take a few minutes to propagate. If a connection test fails immediately after granting access, wait a few minutes and retry before troubleshooting further.
GET on the site’s permissions to see existing grants, including any stale or duplicate entries from a previous app registration:
Source location
Target location
Configure encryption in a Target gem to encrypt an entire file. Use the
DataEncoderDecoder gem to encrypt individual
columns.

