Google Sheets + Mulesoft

Sync Data Between Google Sheet and Salesforce Using Mulesoft Integration Platform

This blog will help you in understanding the process of using the Google Sheet connector provided by MuleSoft with MuleSoft’s Anypoint studio

Prerequisites:

  1. Google Cloud Console Access
  2. MuleSoft's Any point Studio

Google Cloud Console Setup:


Step 1: Log in to http://console.cloud.google.com/



Step 2: Create a new project or choose a previously created project through the drop-down menu.



Step 3: Open the API & Services Tab of your created Project



Step 4: Click on the Library tab from the left-side menu.



Step 5: Search for Google Sheets API



Step 6: Enable API by clicking on Manage Tab.



Step 7: Now Go to the credentials tab from the left-side menu.



Step 8: Click on create credentials and choose OAuth ClientID.



Step 9: Choose a web Application.



Step 10: Name your application and add the following URL http::// < localhost >/oauth2callback in place of Authorized redirect URIs which will serve as the OAuth provider for the API as we are using an external OAuth service.



Step 11:Click create and check your credentials.



Anypoint Studio Setup:

Step 1:Get Spreadsheets Values Connector from Marketplace.



  • Go to Mule palette and Add Google Sheet Connector from Exchange,


  • Create a basic mule flow and add the Get Spreadsheet Values connector to the flow.


Step 2:Create configurations for sheet connector and make sure your redirect URI in google cloud console and callback path in configuration should be same.



Step 3:Add the following values in HTTP_CONFIG.



Step 4:Copy the sheets values from your Spreadsheet URL and paste it in connector. “ https://docs.google.com/spreadsheets/d/ < SpreqdSheetId >/edit#gid= < SheetId >”



Step 5:Add the transform message for change the input for salesforce connector according to your sheet data.



Step 6:Drag the Salesforce create connector.



Step 7:Add configurations for salesforce connector and add your salesforce credentials.



Step 8:Click test connection.



Step 9:Save and run the project.


Step 10:Now go to browser tab and search http://< localhost value >:8081/oauth2callback. And give all the permission to retrieve access Token.



Step 11:Open Postman and run your project and check in salesforce.


Related Blogs