# Can't get "Property to include in code" to work

**URL:** <https://community.hubspot.com/t/cant-get-property-to-include-in-code-to-work/81968>\
**Category:** Data Hub\
**Created:** [May 24, 2023, 9:07pm UTC](https://community.hubspot.com/t/cant-get-property-to-include-in-code-to-work/81968 "2023-05-24T21:07:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RodWaynick1](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@RodWaynick1](https://community.hubspot.com/u/RodWaynick1)\
**Post date:** [May 24, 2023, 9:07pm UTC](https://community.hubspot.com/t/cant-get-property-to-include-in-code-to-work/81968/1 "2023-05-24T21:07:18Z")

</div>

First off, I’m very new to custom coded actions and coding in general. Very little experience at all.

I’ve looked over lots of documentation and can’t seem to get this to work.  
I’d like to include a deal property in a custom coded action. I’ve added the property to the list of properties to include and given it a key. I’ve referenced this in the code (shown below) the way [this article](https://developers.hubspot.com/docs/api/workflows/custom-code-actions#add-hubspot-properties-to-your-custom-code) says to.

 ![Screen Shot 2023-05-24 at 3.58.04 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/0/5/05ff8152e29d66bb3ac5edad50601ecf67f986f7.png)

However, I’m getting the following error:

`2023-05-24T20:52:21.317Z	ERROR	Invoke Error {"errorType":"ReferenceError","errorMessage":"event is not defined","stack":["ReferenceError: event is not defined"," at Object.main (/var/task/file.js:11:13)"," at Runtime.exports.hubspot_handler [as handler] (/var/task/hubspotHandler.js:6:21)"," at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1086:29)"]}`

“event is not defined” and it’s pointing to the const ein = event.inputFields[‘ein’].

What am I missing here? I’ve copied and pasted directly from articles, tutorials, and code examples.

```lia-code-sample
var axios = require('axios');

function main(){
const ein = event.inputFields['ein'];
var data = JSON.stringify({
 "ticket": {
 "comment": {
 "body": `The smoke is very colorful. \n EIN: ${ein}`
 },
 "priority": "urgent",
 "subject": "My printer is on fire!"
 }
});

var config = {
 method: 'POST',
 url: 'https://example.zendesk.com/api/v2/tickets',
 headers: {
	'Content-Type': 'application/json',
	'Authorization': 'Basic <token>', // Base64 encoded "username:password"
 },
 data : data,
};

axios(config)
.then(function (response) {
 console.log(JSON.stringify(response.data));
})
.catch(function (error) {
 console.log(error);
})}

 module.exports.main = main;

```

---

<div class="post-metadata">

**Author:** ![kvlschaefer](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kvlschaefer/32/71076_2.png) [@kvlschaefer](https://community.hubspot.com/u/kvlschaefer)\
**Post date:** [May 25, 2023, 12:36pm UTC](https://community.hubspot.com/t/cant-get-property-to-include-in-code-to-work/81968/2 "2023-05-25T12:36:59Z")

</div>

Hi @RodWaynick1,

Thank you for reaching out to the Community!

I wanted to invite our subject matter experts to this conversation.

Hi @ChrisoKlepke, @miljkovicmisa, @louischausse - Do you have any insight for @RodWaynick1?

Thank you!

Best,

Kristen

---

<div class="post-metadata">

**Author:** ![JBeatty](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jbeatty/32/52252_2.png) [@JBeatty](https://community.hubspot.com/u/JBeatty)\
**Post date:** [May 25, 2023, 9:39pm UTC](https://community.hubspot.com/t/cant-get-property-to-include-in-code-to-work/81968/3 "2023-05-25T21:39:15Z")

</div>

Hi @RodWaynick1,

You have a very small typo in your definietion of the function. event is passed into the function as parameter. So you should be doing:

```lia-code-sample
// Instead of:
function main(){

// do:
function main(event, callback){

//And you can remove your module epxorts line if you do this at instead:
exports.main = async (event, callback) => {

```

Best,
