Back to Case Studies
2024-07-12

Custom Coded Actions: The Secret Weapon of HubSpot Operations

By Trunk Tech Solutions
#HubSpot#Operations Hub#Serverless

Custom Coded Actions in HubSpot

HubSpot's standard workflow actions are great for 80% of use cases. But what about the other 20%? That's where Custom Coded Actions come in.

Why use custom code?

  1. Complex Data Transformations: Need to calculate a custom commission based on three different objects? Standard actions won't cut it.
  2. External API Orchestration: Trigger a shipment in your ERP or a message in a custom app directly from a deal stage change.
  3. Advanced Validation: Validate VAT numbers or email domains against external databases before allowing a contact to proceed.

Example: Validating an API Key

const axios = require('axios');

exports.main = async (event, callback) => {
  const apiKey = event.inputFields['api_key'];
  
  try {
    const response = await axios.get(`https://api.service.com/validate?key=${apiKey}`);
    callback({
      outputFields: {
        is_valid: response.data.valid,
        tier: response.data.tier
      }
    });
  } catch (err) {
    console.error(err);
  }
};

At Trunk Tech Solutions, we specialize in building these technical bridges that turn HubSpot into a fully integrated business engine.

Need similar results?

Let's discuss how we can engineer a custom solution for your HubSpot environment.

Start a Project