# Custom Code - output not being recorded

**URL:** <https://community.hubspot.com/t/custom-code-output-not-being-recorded/123497>\
**Category:** APIs & Integrations\
**Created:** [January 8, 2025, 3:39pm UTC](https://community.hubspot.com/t/custom-code-output-not-being-recorded/123497 "2025-01-08T15:39:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ABatchelor8](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@ABatchelor8](https://community.hubspot.com/u/ABatchelor8)\
**Post date:** [January 8, 2025, 3:39pm UTC](https://community.hubspot.com/t/custom-code-output-not-being-recorded/123497/1 "2025-01-08T15:39:36Z")

</div>

I have a really annoyng issue that im sure I’m just missing something simple. I have a workflow with some custom code, I’m trying to retrun a value into an output field but uts just not showig but it successsfully shows in the logs.

Here is an an example:

exports.main = async (event) =\> {  
const testValue = “Static Test Value”;

const output = {  
outputFields: {  
iname: testValue  
}  
};

console.log(“Returning Output:”, JSON.stringify(output));

return output;  
};

 ![ABatchelor8_0-1736350714214.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/1/a/1a10cf43c62b1d2adea6df9e27f42e233bbb45f3.png)

---

<div class="post-metadata">

**Author:** ![evaldas](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/evaldas/32/69160_2.png) [@evaldas](https://community.hubspot.com/u/evaldas)\
**Post date:** [January 8, 2025, 7:33pm UTC](https://community.hubspot.com/t/custom-code-output-not-being-recorded/123497/2 "2025-01-08T19:33:53Z")

</div>

Hi @ABatchelor8,

If you are using Node.js in the custom coded workflow action, you should use the callback parameter instead of the return statement.

Your code would look something like this:

```lia-code-sample
exports.main = async (event, callback) => {
const testValue = "Static Test Value";

// checking output value in console
console.log("Returning Output:", testValue);

 callback({
 outputFields: {
 iname: testValue
 }
 });

};

```

---

<div class="post-metadata">

**Author:** ![ABatchelor8](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@ABatchelor8](https://community.hubspot.com/u/ABatchelor8)\
**Post date:** [January 8, 2025, 8:03pm UTC](https://community.hubspot.com/t/custom-code-output-not-being-recorded/123497/3 "2025-01-08T20:03:51Z")

</div>

Legend +
