Fuse Templates (Samsara) - Integrating Samsara with Limble using Fuse

Created by Joshua Merrell, Modified on Tue, 16 Apr at 11:23 AM by Joshua Merrell

Overview

This guide steps through the process of implementing templatized Samsara integration Scenarios in Limble Fuse. Within Limble Fuse, each scenario performs a contained integration. We have created 3 unique Fuse Scenarios that can be used in your Limble Fuse account to perform the following actions between Limble and Samsara:
- When a Limble Asset is given a populated 'Samsara Gateway Serial' field, associated the Gateway Serial in Samsara, then populated the Limble Asset with fields such as 'Samsara: 'obdMileageMeters', 'obdEngineSeconds', 'VIN', 'Make', and 'Model'.

- Regularly poll Samsara for the latest values to these fields and sync the results with Limble

- Listen to Samsara for new DVIR reports and Vehicle Faults. For each DVIR Defect or Fault reported, automatically create a Limble WO (workorder task) and update it with Vehicle information


This guide assumes you currently have no Samsara integrations and wish to add all of the above to your Limble Fuse account. At a high level, this process involves:

  • Creating Instances of Scenario Templates

  • Creating and using webhooks in Limble and Samsara for the Scenario instances

  • Creating Triggers in the Samsara account for your Fuse integrations

  • Updating the instances of the Fuse Scenarios to point to the Samsara and Limble accounts

  • Organizing your new Scenarios within Fuse by folders


Steps

  1. Login to your Limble account and navigate to the Limble Fuse integration portal

  2. Upon entering the portal, you will be presented with a list of existing Scenarios. Create a new folder titled 'Samsara'

Navigate to the 'Templates' page, then scroll down until you find the available "[Samsara]..." templates.



  1. Let's make an instance of the first of three. Click on "[Samsara] Limble Asset Sync | Gateway Association", then click "Create new Scenario From Template".

  2. Upon entering the management view of the new scenario, disregard and close any error notification.

  3. Click on the whitespace to enter editor mode. Click and drag whitespace to move the view of the Scenario. You can also scroll to zoom in or out.

  4. Scroll in and click on the first (red) module, named "Listen for Limble Asset Updates". Then click on "Add" next to the dropdown menu. Name the new webhook "Limble Asset Events" and click "Save".



  1. You should now see a blue url link, which is the address for the newly created webhook. Copy the blue webhook address for use in a subsequent step and click ‘OK’. 

  2. Leave this browser tab as is and open a new tab. Navigate to your Limble account. In the ‘Settings’ menu, scroll down to the ‘API Settings’ section

  3. You should see three fields: ‘Asset Webhook Endpoint’, ‘Asset Field Webhook Endpoint’ and 'Task Webhook Endpoint'. 'Add' to all three of these the address you copied in Step 5. Then return to the Fuse browser tab.

  4. Your screen should currently show a Scenario that looks somewhat similar to this:



  5. In the Scenario view, you should see that there are several dark blue Samsara modules. These are used by Limble Fuse to send and retrieve data to the Samsara Org. Click on one of these Samsara modules then click "Add Connection".

  6. Click on "Add" next to the 'Connection' dropdown menu (the menu should be empty for you). Leave the field that appears alone and navigate to your Samsara account portal

  7. In the Settings menu, navigate to ‘API Tokens’ near the bottom. Click ‘Add an API Token’

  8. This token will be used by Limble Fuse to send date to the Samsara Org. In the configuration page, give the new token a name of “Samsara:<Org name> <> Limble Fuse”. Under ‘Scopes’, add “Global Read” and “Global Write” permissions. Scroll down and click ‘Save’

  9. After saving the new Token, you should see a notice with the full token text (starting with “samsara_api_” and a notification message. Click ‘Copy to Clipboard’ and past in a notepad for use in an the next step. Navigate back to Limble Fuse.

  10. In the "Samsara API Access Token" field, type "Bearer " and then paste the token you copied from Samsara (with a space after the word "Bearer"). Click save.

  11. In the dropdown "Connection" menu, click the new option that you just created, then click ‘OK’ to save this change.

  12. Click on another Samsara module within the Scenario. Click the ‘Connection’ dropdown and select the correct Org. It is available in the menu now that we’ve created it. Click “OK” to save.

  13. Update all the other dark blue Samsara modules to point to the new Samsara Org, saving each by clicking ‘OK’.

  14. Click on one of the Green 'Limble' Application modules. If the 'Connection' field is empty, click on "Add" to create a connection between Fuse and your Limble account. Fuse will require a "ClientID" and a "Client Secret" which you can find in the Settings page of your Limble Account (click "Refresh Client ID/Secret" there if you need a new one).

  15. Once you have a connection selected for that module, make the same selection in all the other Limble Fuse modules in the scenario.

  16. Find and select module '169'

  17. Click "Add" to create a needed Datastore

  18. Name the new Datastore "Samsara: Activated Gateways". Click "Add" to create a new associated Data Structure, and give it the same name.

  19. Click "Add Item" 5 times and enter the following property details:
    Name: 'key', Type: 'text'
    Name: 'Gateway Serial', Type 'text'
    Name: 'Vehicle ID', Type 'number'
    Name: 'Limble Asset ID', Type 'number'
    Name: 'Limble Field Value ID', Type 'number'

  20. Click "Save" for both the Data Structure and the Data Store.

  21. For Modules 176, 273, 277, and 396 select the same 'Samsara: Activated Gateways' Data Store and click "OK" to save.

  22. Click on Module 286 and create a new Data Store titled "Limble: Samsara Gateway Field", along with a new Data Structure with 4 properties as follows:
    Name: 'key', Type: 'number'
    Name: 'Value ID', Type: 'number'
    Name: 'Asset ID', Type: 'number'
    Name: 'Gateway Serial', Type 'text'

  23. Save these and ensure the fields are mapped as in this screenshot, then click "OK"

  24. Use the same module and field mappings for Modules 287 and 288.

  25. Click on module 138, a purple 'JSON' module, then click "Add" to create a new Data Structure named "Samsara: Add ExternalID". Give this module a 'externalIds' property of type 'Collection'. Within that collection, add a single property named 'limbleAssetID' of type 'Text'. Ensure spelling and capitalization matches this direction

  26. Click "Save" and "OK". Select the same Data Structure in modules 274 and 392 (all purple 'JSON' modules), saving each

  27. Click on module 389 (another purple 'JSON' module). Click "Add" to create a new Data Structure named 'Resolve Defect'. Give this module a 'isResolved' property of type 'Text'. Give it another property called 'resolvedBy' of type 'Collection'. Within that collection, add the following two properties:
    Name: 'id', Type: 'Text'
    Name: 'type', Type: 'Text', Default: 'mechanic'

  28. Click "Save" and "OK" within module 389.

  29. Click the Save icon at the bottom of the screen. Follow the error link to enable the Scenario to save incomplete executions

  30. After toggling to "Yes", click "OK" and save the scenario again.

  31. The scenario should save without error. If you do have errors, you can attempt to solve them yourself, or reach out to integrations@limblecmms.com for assistance.

  32. Click the top left arrow icon twice to leave the Scenario configuration page and return to the list of Scenarios. Locate the newly created scenario in the list, and move it to your 'Samsara' folder for keeping things organized

  33. Let's add the second Scenario. Navigate to 'Templates' and select the Scenario titled "[Samsara] DVIR Create/Update -> Limble". Ignore and close the error when brought to the Scenario management screen.

  34. For each of the dark blue Samsara App modules (there should be 5), select the connection you made earlier from the dropdown and click "OK".

  35. For each of the green Limble App modules, select the connection to your Limble account from the dropdown and click "OK".

  36. click on the first module in the scenario (red webhook) and click "Add". Name the new webhook "Samsara: Faults and Alerts" and click save. Copy the webhook url address and save it for use in the next step.

  37. Navigate to your Samsara account portal again.

  38. In the 'Settings' menu, scroll down and click on 'Webhooks'

  39. Let’s create a new Webhook, which tells Samsara where to send information about Vehicle Faults and DVIR events when they occur.

  40. In the new menu that appears, name the webhook “Limble Fuse”. In the ‘Payload URL’ field, paste the address you saved from Step 39. **no changes**. Click ‘Save’

  41. Refresh the browser and confirm that the new Webhook appears. You should see that the ‘Configured Alerts’ section is currently empty. We will address this next.

  42. Now that we have the webhook defined, let's tell Samsara when to use it. In the left Navigation Bar, click on ‘Alerts’.

  43. Click ‘Create Alert’. Rename it “DVIR Submitted -> Limble Fuse Webhook”. In the ‘Triggers’ section, select “DVIR Submitted”. In the ‘Condition’ section, add all DVIR types. In the 'Apply To' section, select "All Assets". Remove the ‘Notification’ Action and instead add a new ‘Webhook’ Action, selecting the “Limble Fuse” Webhook we created earlier, as shown below. Click ‘Save’

  44. Let’s add another Alert. This time, select the “DVIR Defect” trigger.

  45. In the details page that appears, click ‘Edit asset selection’, then click “All Assets”, then click “Done selecting assets”. 

  46. In the ‘Send Webhook Notification’ dropdown, select “Limble Fuse”. Verify your details look like the following screenshot, then click ‘Save’

  47. Create one more Alert. Select the “Vehicle Fault Code” trigger and update the details as shown below, then click ‘Save’

  48. Navigate back to your Limble Fuse browser tab. Click on module 64. Create a new Data Structure named "Samsara: Defect 'mechanicNotes'". Give it a single property with Name 'mechanicNotes' and Type 'Text'. Click "Save" and "OK".

  49. Click on Module 98. Click "Add" to create a new Datastore.

  50. Name the new Datastore "Samsara: User". Click "Add" to create a new associated Data Structure, and give it the same name.

  51. Click "Add Item" 2 times and enter the following property details:
    Name: 'name', Type: 'text', Required: 'true'
    Name: 'id', Type 'text'


  52. "Click" Save and "OK" to use this new datastore in module 98.

  53. Select the same datastore for module 99, then save the module.

  54. Attempt to save the Scenario, allow incomplete executions (as we did for the other Scenario), then save again. The Scenario should save without further errors at this point.

  55. Click the back arrow twice, located and move the new Scenario to your 'Samsara' folder.

  56. Navigate to 'Templates' and select the final template to copy from, called "[Samsara] Regular Vehicle -> Limble Asset Sync"

  57. Point each (should be 3) Samsara module to your account Connection. Point each Limble module to your account Connection.

  58. In modules 54, 56, 57, and 58, select the 'Samsara: Activated Gateways' Data Store from the dropdown and click "OK".

  59. Save the Scenario, click the back arrow twice, and move the new Scenario to the 'Samsara' folder.

  60. Ensure that each of the three new Scenarios are enabled. If not already, toggle the switches to “On”. If prompted, select "Delete old Data"

  61. From your Scenario list, open '[Samsara] Regular Vehicle -> Limble Asset Sync'. Run the scenario one time manually to initialize data.

  62. From your Scenario list, open '[Samsara] DVIR Create/Update -> Limble'.

  63. Click the first Module, titled 'Listen for Samsara Vehicle Updates & DVIR Submit'. Click the "Copy address to clipboard" button.

  64. From the Main Fuse Dashboard, click on "Templates". Locate '[Samsara] Register Webhook' and click "Create new scenario from template". 

  65. Click on the first Module, titled 'Request Body'. Add a new Data Structure called 'Samsara New Webhook' with the following fields:
    Name: 'name', Type: 'Text'
    Name: 'url', Type: 'Text'
    Name: 'eventTypes', Type: 'Array'
    Save the new Data Structure. Within the module, paste the url link you copied a few steps ago into the 'url' field. Add the value "VehicleUpdated" to the 'eventTypes' field, as seen below. Click "OK".

  66. Click on the Module titled "Register Samsara Webhook". Select your Connection from the Dropdown and then click "OK".

  67. Click on "Run once" and wait for the Scenario to complete. If you see any error, contact "integrations@limblecmms.com" for support.

  68. After running the Scenario one time, return to the 'All Scenarios' page and DELETE the '[Samsara] Register Webhook' Scenario.

  69. Click on "Data Stores" and click 'Browse' for the "Samsara: User" Datastore.


  70. Click 'Add'. In the new data row, replace the value of the "name" field with the name of the user in your Samsara account whom you want to be associated when Limble users close a WO that is associated with a Samsara DVIR. Currently, this must be the same user every time. Find the user in Samsara you wish to use and paste the first and last name into the new Data Structure 'name' field value exactly.

  71. Click 'Save', then return to the Fuse Home Screen.

  72. Navigate to 'Templates' again and find the '[Samsara] User Setup' scenario.

  73. Click 'Create new scenario from template'. Select your account connection for the "Samsara" module.

  74. In the blue "Data store" modules, ensure that 'Samsara: User' is selected from the dropdown. Leave other settings as they are.

  75. Click "Run once". This scenario will then retrieve the id associated with your preferred Samsara user and store it for use when creating DVIR associated Workorders in Limble. You only need to run the Scenario once. If you encounter any error at this stage, contact Limble support.

    ** Data Import ***

  76. You now have all needed Fuse scenarios enabled to allow for integration between Samsara and Limble, and are ready for data import. To import your Samsara fleet information to start using the configured Fuse Scenarios, follow these final few steps for each vehicle you wish to synchronize with Limble

  77. Open the '[Samsara] Regular Vehicle > Limble Asset Sync' Scenario. Click white space to enter the editor, then click the "Run Once" play button. Wait until the Red "Stop" button goes away and the Scenario finishes executing. If you see any errors, stop here and reach out to the Limble Integrations team for support.

  78. From your Samsara Org Dashboard, navigate to the 'Assets' page. Find the asset you wish to connect to Limble.

  79. Copy the Gateway Serial for the vehicle. This is usually printed directly below the vehicle name and follows the format XXXX-XXX-XXX.

  80. Locate or create the matching Asset for this vehicle in Limble.

  81. Add a custom field to the Asset with the title "Samsara: Gateway Serial", type Text. You will only need to create this for the first asset at each location.

  82. Paste the serial number into the value box for the custom field on the Asset. If the integration is set up properly, you should see Samsara data populated for the Asset in the next few minutes. You can also visit the Scenario page in Fuse to verify the Scenario was triggered and view it's completion details in the logging page.



Finished! Your Limble account is now integrated with your Samsara Org. If you have more than one Samsara Org and wish to integrate each with Limble, this must be done separately for each. Follow our guide on replicating Scenarios for new Samsara Orgs.



Check back to your Fuse Scenario Dashboard regularly to see if any errors have stopped your Scenarios from running. If so, they will be automatically toggled to “OFF” and will display helpful information in the logs. Address the issues and then re-enable the Scenario.


Integrations in the past may have taken you months, or weeks - but with Limble Fuse, it can be done in an afternoon!


Questions, comments, feedback? Contact integrations@limblecmms.com for guidance, or submit a ticket via our "Submit a Ticket" option in the upper right of this portal.

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