# PlanGrid and Microsoft SharePoint recipe
This use case guides you through connecting PlanGrid and Microsoft SharePoint to create a powerful automation.
# What does this recipe do?
This recipe synchronizes new and updated safety inspection field reports from PlanGrid to Microsoft SharePoint.
# Create your recipe
Complete the following steps to create a recipe that synchronizes new and updated safety inspection field reports from PlanGrid to Microsoft SharePoint:
USE CASES ARE INTENDED AS EXAMPLES ONLY
This use case is intended to serve as an example. Recipe modifications such as trigger and action configuration and conditional logic may require adjustments if you plan to include this recipe in your own workflow.
Sign in to your Workato account and go to the workspace project where you plan to add the recipe.
Set up connections for PlanGrid and Microsoft SharePoint using the steps in the following sections:
Set up your PlanGrid connection.
Click Create > Connection.
Search for and select PlanGrid
in the New connection page.
Provide a name for your connection in the Connection name field.
PlanGrid connection setup
Use the Location drop-down menu to select the project where you plan to store the connection.
Click Connect. A PlanGrid OAuth dialog appears.
Click Give Permission to authorize Workato to establish the connection.
Set up your Microsoft SharePoint connection.
To connect Microsoft SharePoint to Workato, you must have an Azure account. Workato supports the following authentication methods:
# Authorization code grant connection
This method requires the following fields:
- Subdomain
- Client ID (optional)
- Client Secret (optional)
# Step 1: Register the Workato app in Microsoft SharePoint and generate a client ID and secret
Complete the following steps to register the Workato app and generate a client ID and secret for authorization code grant connections:
Sign in to your Azure Portal (opens new window).
Go to Microsoft Entra ID > Manage > App registrations and click New registration.
Enter a name for the application in the Name field.
Specify who can use this application in the Supported account type field.
Use the Select a platform drop-down menu to select Web.
Enter https://www.workato.com/oauth/callback
in the Redirect URI field.
Click Register.
Go to Manage > API permissions and click Add a permission.
Select SharePoint as your API.
Select the Delegated permissions option.
Expand AllSites within the Select permissions field and select the AllSites.Read (Delegated) checkbox.
Go to Manage > Certificates & secrets and click New client secret.
Enter a description for the client secret in the Description field.
Use the Expires drop-down menu to set the expiration date for the client secret.
Click Add to create the client secret.
Click Copy to clipboard next to the Value after you create the secret. This is your Client Secret. Save this value in a secrets vault.
Go to Overview and copy the Application (client) ID value. This is your Client ID.
You can now configure your Microsoft SharePoint connection in Workato using the API permissions you set up in the Azure Portal.
# Step 2: Complete setup in Workato
Click Create > Connection.
Search for and select Microsoft Sharepoint
in the New connection page.
Provide a name for your connection in the Connection name field.
Microsoft SharePoint connection setup
Use the Authentication type drop-down menu to select Authorization code grant.
Enter your SharePoint subdomain as found in your SharePoint URL in the Subdomain field. For example, if your SharePoint URL is https://abc.sharepoint.com
, the subdomain is abc
.
Enter the client ID generated in SharePoint in the Client ID field.
Enter the client secret generated in SharePoint in the Client secret field.
Enter the name of the SharePoint site you plan to connect to in the Site name field. If left blank, Workato connects to your default home site. Use the site name as found in the URL of the site page. For example, if the URL is https://company-name.sharepoint.com/sites/product
, the site name is product
.
Click Sign in with Microsoft.
Enter your credentials to sign in.
Click Accept to authorize the app you created in your Azure Portal.
# Client credentials grant connection
This method requires the following values:
- Subdomain
- Tenant ID
- Client ID
- Certificate
- Private Key
# Step 1: Register the Workato application in Microsoft SharePoint
Complete the following steps to register the Workato app and obtain a client ID, secret, and private key for client credentials grant connections.
Sign in to your Azure Portal (opens new window).
Go to Microsoft Entra ID > Manage > App registrations and click New registration.
Enter a name for the application in the Name field.
Specify who can use this application in the Supported account type field.
Use the Select a platform drop-down menu to select Web.
Enter https://www.workato.com/oauth/callback
in the Redirect URI field.
Click Register.
Go to Manage > API permissions and click Add a permission.
Select SharePoint as your API.
Select the Application permissions option.
Expand Sites in the Select permissions section and select the Sites.Read.All (Application) checkbox. Ensure that admin consent is granted in the Status column.
Go to Manage > Certificates & secrets > Certificates and click Upload certificate.
Upload a certificate if you already have one. If not, you can generate the certificate locally using tools such as OpenSSL or PowerShell.
Go to Overview and copy the Application (client) ID value. This is your Client ID.
Copy the Directory (tenant) ID value. This is your Tenant ID.
You can now configure your Microsoft SharePoint connection in Workato using these required values.
# Step 2: Configure your Microsoft SharePoint connection in Workato
Click Create > Connection.
Search for and select Microsoft Sharepoint
as your connection.
Provide a name for your connection in the Connection name field.
Microsoft SharePoint connection setup
Use the Authentication type drop-down menu to select Client credentials.
Enter your SharePoint subdomain as found in your SharePoint URL in the Subdomain field. For example, if your SharePoint URL is https://abc.sharepoint.com
, the subdomain is abc
.
Provide the tenant ID generated in SharePoint in the Tenant ID field.
Provide the client ID generated in SharePoint in the Client ID field.
Provide the certificate generated in SharePoint in the Certificate field.
Provide the private key string generated in SharePoint in the Private key field.
Enter the name of the SharePoint site you plan to connect to in the Site name field. If left blank, Workato connects to your default home site. Use the site name as found in the URL of the site page. For example, if the URL is https://company-name.sharepoint.com/sites/product
, the site name is product
.
Click Sign in with Microsoft.
Click Create > Recipe.
Provide a name for your recipe in the Name field and select the project in which you plan to store the recipe from the Location drop-down menu.
Ensure that Trigger from an app is selected under Pick a starting point and click Start building.
Set up your recipe
Set up your PlanGrid New or updated object trigger.
Search for and select PlanGrid
in the Choose an app search box.
Choose PlanGrid
Select New or updated object in PlanGrid as your trigger.
Select the New or updated object in PlanGrid trigger
Use the Object drop-down menu to select Field Report.
Use the Project drop-down menu to select your project.
Configure the trigger
Click the Set trigger condition toggle.
Set trigger condition
Map the PlanGrid Status | Step 1
datapill to the Trigger data field.
Use the Condition drop-down menu to select equals.
Type submitted
in the Value field.
Set trigger condition
Click +
(plus) and select AND to add a second condition.
Map the PlanGrid Name | Step 1
datapill to the Trigger data field.
Use the the Condition drop-down menu to select contains.
Type Safety
in the Value field.
Set trigger condition
Click Save.
Step summary
This trigger monitors your PlanGrid project for new or updated field reports that include the word Safety
in the file name.
Click the +
Add step button and select IF condition.
Click Add step > IF condition
How do IF conditions work?
An IF condition enables you to make decisions based on specific conditions. You can control your recipe workflow by executing different actions depending on whether a condition you specify is true or false.
Set up your IF condition.
Map the PlanGrid PDF URL | Step 1
datapill to Data field.
Use the Condition drop-down menu to select is present.
Configure your IF condition
Click Save.
Step summary
This step checks if a PDF URL is present in the trigger output.
Click the +
Add step button and select Action in app.
Click Add step > Add action in app
Set up your File tools by Workato Get file from URL action.
Search for and select File tools by Workato
in the Choose an app search box.
Choose File tools by Workato
Select Get file from URL as your action.
Select the Get file from URL action
Map the PlanGrid PDF URL | Step 1
datapill to the URL field.
Map the PDF URL datapill
Click Save.
Step summary
This step retrieves the file contents from the PDF URL.
Click the +
Add step button and select Action in app.
Set up your Microsoft SharePoint Upload file in library action.
Search for and select Microsoft SharePoint
in the Choose an app search box.
Choose Microsoft SharePoint
Select Upload file in library as your action.
Select the Upload file in library action
Enter the name of the Microsoft SharePoint site you plan to connect to in the Site name field. If left blank, Workato connects to the site name specified when you configured your connection.
Select the folder where you plan to upload the field report in the Folder field.
Enter a name in the File name field.
Complete the following steps to configure this field dynamically:
Configure the file name
Switch the File name field to formula mode.
Map the PlanGrid Report Date | Step 1
datapill.
Append the .strftime
formula to format the Report Date
. Enter "%Y-%m-%d"
as the value in the .strftime
formula.
Append the .to_s
formula to convert the Report Date
datapill into a string.
Type + "-" +
to insert a hyphen between the date and document title.
Map the PlanGrid Name | Step 1
datapill.
Append the .gsub
formula to replace spaces with hyphens in the document name. Enter " ", "-"
as the value in the .gsub
formula.
Type + ".pdf"
to complete the file name with the .pdf
extension.
File name configuration
This configuration applies the following naming convention:
YYYY-MM-DD-YOUR-SAFETY-FIELD-REPORT-TITLE.pdf
For example:
2024-10-09-Daily-Safety-Inspection.pdf
Map the File tools by Workato File contents | Step 3
datapill to the File contents field.
Map the File contents datapill
Click Save.
Step summary
This step uploads the PlanGrid field report PDF file to a folder you specify in Microsoft SharePoint.
Your PlanGrid and Microsoft SharePoint recipe is ready to test and implement.
Example recipe configuration.
PlanGrid and Jira recipe
Last updated: 11/4/2024, 6:09:46 PM