# Workflows: Accessing Properties to include in code

**URL:** <https://community.hubspot.com/t/workflows-accessing-properties-to-include-in-code/102715>\
**Category:** APIs & Integrations\
**Tags:** workflows\
**Created:** [March 15, 2024, 6:06pm UTC](https://community.hubspot.com/t/workflows-accessing-properties-to-include-in-code/102715 "2024-03-15T18:06:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeffBantz](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jeffbantz/32/43872_2.png) [@JeffBantz](https://community.hubspot.com/u/JeffBantz)\
**Post date:** [March 15, 2024, 6:06pm UTC](https://community.hubspot.com/t/workflows-accessing-properties-to-include-in-code/102715/1 "2024-03-15T18:06:00Z")

</div>

My sincere apology for what should be a very simple question.  
Scenario:

I am building a workflow and have a Custom Code module that returns a set of values as the output. I want to use those values further along in the workflow in another custom code module.

 ![JeffBantz_0-1710525571903.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/b/e/be474055fac50268181d10e742cce7868660b065.png)

In the second module, I have connected the two values I need.

For the life of me, I am unable to determine how to correctly define them inside my custom code.

ChatGPT and copilot say

// Inside Module 2  
const MyResultFromModule1 = input.MyMgmtCoID;

But, that generates an error “input” not defined

---

<div class="post-metadata">

**Author:** ![Humashankar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/humashankar/32/30856_2.png) [@Humashankar](https://community.hubspot.com/u/Humashankar)\
**Post date:** [March 16, 2024, 2:05am UTC](https://community.hubspot.com/t/workflows-accessing-properties-to-include-in-code/102715/2 "2024-03-16T02:05:53Z")

</div>

Hi @JeffBantz

Seams System treats - MyMgmtCoID is the name of the input you connected from Module 1 to Module 2

Assume Module 1 has an output named MyMgmtCoID, and Module 2 needs to access this value

// Inside Module 1  
const myMgmtCoID = “123456”; // Example value

return {  
MyMgmtCoID: myMgmtCoID  
};

// Inside Module 2  
const MyResultFromModule1 = input.MyMgmtCoID;

// Use the value from Module 1 in Module 2  
console.log(“My Result from Module 1:”, MyResultFromModule1);

Above instance covers - Module 1 sets the value of MyMgmtCoID to “123456”, and Module 2 accesses this value using input.MyMgmtCoID.

When two modules are connected correctly in your workflow.  
Module 2 should receive the output MyMgmtCoID from Module 1

Give a try and keep us posted

Hope this helps - Happy to help further!!  
Thank you very much and have a great one!

Warm regards

---

<div class="post-metadata">

**Author:** ![JeffBantz](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jeffbantz/32/43872_2.png) [@JeffBantz](https://community.hubspot.com/u/JeffBantz)\
**Post date:** [March 18, 2024, 2:58pm UTC](https://community.hubspot.com/t/workflows-accessing-properties-to-include-in-code/102715/3 "2024-03-18T14:58:50Z")

</div>

I got the same answer when I asked ChatGPT - but the problem is that inside the Custom Code module in the HubSpot workflows, the error message when I try to use input.MyMgmtCoID is “input is not defined”

Working backwards from the code sample in the custom module, I was able to get it to come in by using const MgmtCoID = event.inputFields[‘MyMgmtCoID’];
