top of page
Writer's pictureRobert Hebert

Blue Folder API Integration with Wix, using Velo

Updated: Jun 7, 2022

Who is our customer and what problem did they want to solve?

Our client wanted a way to have their users' information entered into their CRM, BlueFolder, from Wix. This would take place when a customer submitted a Claim Request form through the client's website.


Before contacting RHM, our client had the form sending an email to BlueFolder with the information. However, our client still needed to manually input the information that was being sent over.



What solution did we provide?

After a quick call and some consulting of BlueFolder's API documentation, we knew we could automate the process of having their users' information entered into BlueFolder, straight from Wix.


What was our process?

To do this, we tapped into the Wix CRM onFormSubmit event, by creating an 'events.js' file in the backend section of the editor and added a function called `wixCrm_onFormSubmit` that fires every time a Wix Form is submitted on their website.


When the data comes in from this event, we loop through the form fields and set variables for each of the different fields to be used with the BlueFolder API.


Since we are creating resources in the client's CRM, each of the resources we create needs to be stored in the Content Manager so that we are creating as few duplicates as possible in the CRM. The resources we're creating are Customer Contacts and Customer Locations.


And then...

Once the data has been gathered, we query the content manager for the customer ID of the Claims Adjuster that the form is being submitted.


When that's found, we then take the name of the contact and query the content manager to see if a Customer Contact has been created for them already. If it has we store the Customer Contact ID in a variable to be used later. If it hasn't, we call BlueFolder's Add Customer Contact API with the contact's data, and then upon successfully creating the contact, save their name and contact ID in the content manager.


Once this has been done, we query the content manager to see if a Customer Location has been created with the address they provided. If it has, we store the Customer Location ID in a variable to be used later. If it hasn't, we call BlueFolder's Add Customer Location API with the contact's address data, and then upon successfully creating the location, we save the address and location ID in the content manager.


Once this has been done, we take any files that were uploaded through the form and use the `mediaManager` API from the Wix Media Backend module to create a download link of a zip archive of these files.


Once this has been achieved, we take the remainder of the data we gathered from the form as well as the customerID, customerContactID, and customerLocationId and call the BlueFolder Add Service Request API to create the Claim in the CRM.



Below is the code used:


import wixData from "wix-data";

$w.onReady(async function () {
  const claimsAdjusters = await wixData
    .query("ClaimsAdjusters")
    .limit(250)
    .find({ suppressAuth: true })
    .then((results) => results.items)
    .catch((err) => err);

  const claimsAdjustersOptions = claimsAdjusters.map((adjuster) => ({
    label: adjuster.name,
    value: adjuster.name,
  }));

  $w("#adjustersDropdown").options = claimsAdjustersOptions;
});

About our company


RHM specializes in helping businesses of all sizes and across all industries achieve their digital and web marketing needs. Whether it's designing a new website, building an app, performing custom development, or running Google Ads, our goal is to showcase how you are the best at what you do and help people connect with you. Contact us at 225-250-1888 to get started!


19 views0 comments

Kommentare


bottom of page