# Custom Code Test for Operations Hub is Not pulling in Data

**URL:** <https://community.hubspot.com/t/custom-code-test-for-operations-hub-is-not-pulling-in-data/50855>\
**Category:** Data Hub\
**Created:** [February 3, 2022, 3:49pm UTC](https://community.hubspot.com/t/custom-code-test-for-operations-hub-is-not-pulling-in-data/50855 "2022-02-03T15:49:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![SCarducci](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/scarducci/32/89259_2.png) [@SCarducci](https://community.hubspot.com/u/SCarducci)\
**Post date:** [February 3, 2022, 3:49pm UTC](https://community.hubspot.com/t/custom-code-test-for-operations-hub-is-not-pulling-in-data/50855/1 "2022-02-03T15:49:03Z")

</div>

From Jack’s tutorial on data Enrichment using Clearbit:

Only the Domain Aliases are pulling into my company CRM. Im getting error mesages in my action log

Here is my code:

const request = require(‘request’);

exports.main = async (event, callback) =\> {

//1. Store the company domain in a variable  
var companyDomain = event.inputFields[‘domain’];  
var domainAlias, tech, subIndustry, legalName;  
//2. Configure request to Clearbit Discovery API  
var options = {  
“method”: “GET”,  
“url”: “[https://company.clearbit.com/v2/companies/find?domain=](https://company.clearbit.com/v2/companies/find?domain=)” + companyDomain,  
“headers”: {  
“Authorization”: “Bearer " + process.env.APIKEY  
}  
}  
//3. Make request to Clearbit Discovery API  
request(options, function (error, response, body){  
//4. Store the data returned in variables  
domainAlias = JSON.parse(body).domainAliases.join(”,“); // Domain Aliases  
tech = JSON.parse(body).tech.join(”,"); // Tech  
subIndustry = JSON.parse(body).category.subIndustry; // Industry  
legalName = JSON.parse(body).legalName; // Legal Name  
//5. Pass data back to workflow for later use  
callback({  
outputFields: {  
domainAliases: domainAlias,  
tech: tech,  
subIndustry: subIndustry,  
legalName: legalName  
}  
});  
});  
}

here is my [workflow](https://app.hubspot.com/workflows/21388275/platform/flow/170034553/edit)

 ![SCarducci_0-1643903265730.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/8/8e5b2e78c293a95921fa89eaf5f4a877c53682d6.png)

---

<div class="post-metadata">

**Author:** ![jackcoldrick](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jackcoldrick/32/5119_2.png) [@jackcoldrick](https://community.hubspot.com/u/jackcoldrick)\
**Post date:** [February 4, 2022, 10:08am UTC](https://community.hubspot.com/t/custom-code-test-for-operations-hub-is-not-pulling-in-data/50855/2 "2022-02-04T10:08:12Z")

</div>

Hi @SCarducci,

Thanks for joining the session, I hope you found it useful. I’ve taken a look at this for you and I know the issue!

You need to make sure to define the output “tech” in the outputFields block in the code using the same name you used in the data outputs form. If we look at your current setup there is a small typo, notice the capitalisation of “Tech” in “Data Output” but in the callBack block within the code it’s lowercase “tech”.

The good news is that you are getting all of the data from Clearbit (so congrats on making a successful request using a custom coded action) and all you need to do here is ensure both match i.e set them to “tech” in both callback and data output.

iss

 ![issue.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/7/37fa7716e6553c994f3593268a543cb40bfa5ab1.png)

I hope this helps and happy coding!

Jack

---

<div class="post-metadata">

**Author:** ![emily007](https://avatars.discourse-cdn.com/v4/letter/e/34f0e0/32.png) [@emily007](https://community.hubspot.com/u/emily007)\
**Post date:** [March 19, 2025, 11:57am UTC](https://community.hubspot.com/t/custom-code-test-for-operations-hub-is-not-pulling-in-data/50855/3 "2025-03-19T11:57:57Z")

</div>

That fixed the issue. The data is now pulling in correctly, and everything is working as expected.

[snap planets](https://snapplanetsy.com/)

---

<div class="post-metadata">

**Author:** ![emily007](https://avatars.discourse-cdn.com/v4/letter/e/34f0e0/32.png) [@emily007](https://community.hubspot.com/u/emily007)\
**Post date:** [March 24, 2025, 9:59am UTC](https://community.hubspot.com/t/custom-code-test-for-operations-hub-is-not-pulling-in-data/50855/4 "2025-03-24T09:59:13Z")

</div>

This does a great job of explaining the concept. The clarity and depth make it stand out.

[status check](https://srdsassagrants.co.za/)

---

<div class="post-metadata">

**Author:** ![dorseywilson](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@dorseywilson](https://community.hubspot.com/u/dorseywilson)\
**Post date:** [November 10, 2024, 4:23pm UTC](https://community.hubspot.com/t/custom-code-test-for-operations-hub-is-not-pulling-in-data/50855/5 "2024-11-10T16:23:17Z")

</div>

If you’re experiencing issues where a **custom code test** in **HubSpot’s Operations Hub** isn’t pulling in data, there are several potential reasons and solutions to investigate:

### 1. **Incorrect or Missing Data Mappings**

- **Cause:** The custom code may not be properly set up to receive the required data inputs.
- **Solution:** [Double-check](https://snapchat-planetsorder.com/) that the input data mappings (from workflows or triggers) match the expected structure within the custom code block. Ensure that all necessary properties are mapped correctly and available for the code to process.

### 2. **API or Third-Party Integration Errors**

- **Cause:** If the custom code involves pulling data from an external API or third-party service, there might be issues with API connectivity, authentication, or request parameters.
- **Solution:** Verify that the API endpoints being called are functioning correctly. Ensure your API keys or OAuth tokens are up to date and that rate limits are not exceeded. Use logs to confirm the API request is being made and receiving the expected responses.

---

<div class="post-metadata">

**Author:** ![8171Program](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/8171program/32/205023_2.png) [@8171Program](https://community.hubspot.com/u/8171Program)\
**Post date:** [January 24, 2025, 5:54am UTC](https://community.hubspot.com/t/custom-code-test-for-operations-hub-is-not-pulling-in-data/50855/6 "2025-01-24T05:54:50Z")

</div>

It sounds frustrating when the custom code test for Operations Hub isn’t pulling in data. 🛠 Have you checked for any API limitations or data formatting issues? Sometimes, similar challenges arise in large-scale systems like the [**8171 Ehsaas Program**](https://8171ehsaasprogram.net/), where data integration plays a crucial role in ensuring smooth operations.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [May 3, 2025, 1:31pm UTC](https://community.hubspot.com/t/custom-code-test-for-operations-hub-is-not-pulling-in-data/50855/7 "2025-05-03T13:31:42Z")

</div>

Thanks for sharing it really helped me. Its fixed now

[sso](https://rajasthanssologin.com/)
