How can I connect Google Sheets to WealthBlock (without Zapier)? (User Updates, Web Hooks)

Modified on Thu, Feb 24, 2022 at 1:02 PM

In Google Sheets, you can deploy your script as a web app that generates a unique URL and paste the URL to the WealthBlock platform.


To initiate your script, you can follow the steps below:

  1. Open a new Google Sheets form
  2. Go to the Tools menu and select Script Editor


  3. Paste this script into the script code editor
     
    //this is a function that fires when the webapp receives a GET request
    function doGet(e) {
      return HtmlService.createHtmlOutput('request received');
    }
    //this is a function that fires when the webapp receives a POST request
    function doPost(e) {
      var post = JSON.parse(e.postData.contents);
      var vd = post;
      var sheet = SpreadsheetApp.getActiveSpreadsheet();
      var lastRow = Math.max(sheet.getLastRow(),1);
      var lastcol=1;
      sheet.insertRowAfter(lastRow);
      sheet.getRange(lastRow + 1, lastcol++ ).setValue(vd.uid);
      sheet.getRange(lastRow + 1, lastcol++ ).setValue(vd.username);
      sheet.getRange(lastRow + 1, lastcol++ ).setValue(vd.profile.firstName);
      sheet.getRange(lastRow + 1, lastcol++ ).setValue(vd.profile.lastName);
      sheet.getRange(lastRow + 1, lastcol++ ).setValue(vd.profile.emailOptOut);
      sheet.getRange(lastRow + 1, lastcol++ ).setValue(vd.accountIds ? vd.accountIds[0] : '');
      SpreadsheetApp.flush();
      return HtmlService.createHtmlOutput('post request received');
    }


  4. Click Save
  5.  From the Publish menu, select Deploy as a Web App
  6. Select to execute the app as Me and allow Anyone, even anonymous to execute the script
  7. Click Deploy



  8. You will be asked to review permissions
  9. Click on Review Permissions and select your account
  10. Choose Advanced
  11. Click Go to the Webhooks
  12. Click Allow


  13. Copy the webhook URL 
  14. Navigate to your WealthBlock platform 
  15. Select Platform from the left menu
  16. Choose Settings
  17. Select Integrations
  18. Paste the webhook URL into the Post user profile updates to a Web Hook field



  19. Any updates to users will appear in your Google Sheet
    • You can follow the example row below, and customize columns as needed



REF: Do you have integration with Hubspot, Salesforce (or any other CRM or apps)?

#automation, integration, google script, google sheet, webhook, web hook






Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article