# How to create a custom field for modules?

**URL:** <https://community.hubspot.com/t/how-to-create-a-custom-field-for-modules/98409>\
**Category:** CMS Development\
**Tags:** design-manager\
**Created:** [January 23, 2024, 10:00am UTC](https://community.hubspot.com/t/how-to-create-a-custom-field-for-modules/98409 "2024-01-23T10:00:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshuamiller](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@joshuamiller](https://community.hubspot.com/u/joshuamiller)\
**Post date:** [January 23, 2024, 10:00am UTC](https://community.hubspot.com/t/how-to-create-a-custom-field-for-modules/98409/1 "2024-01-23T10:00:35Z")

</div>

Hello Hubspot-Community,  
I’m trying to add two custom fields to the modules, which are supposed to set the Top and Bot margins of the Modules. Those margins are the same across all 30+ Modules and it would be a blessing if I could add a custom field, so I only have to select the field without editing anything.  
I added a custom field to the fields.json but somehow it’s not showing in die Add-Field-Select Dropdown Menu when I create custom modules.  
Does anyone have experience with that and could help me?  
That what i added to .json:

{  
“name”: “Spacing\_Top”,  
“label”: “Spacing-Top”,  
“required”: true,  
“locked”: false,  
“Multiple”:“false”,  
“display”: “select”,  
“choices” : [[ ", “No Spacing”],[“module-spacing-md-top”, “Medium Spacing (5rem)”], [“module-spacing-lg-top”, “Large Spacing (7.5rem)”] ],  
“type”: “choice”,  
“default”: “module-spacing-lg-top”  
},  
Best regards,  
Joshua

---

<div class="post-metadata">

**Author:** ![joshuamiller](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@joshuamiller](https://community.hubspot.com/u/joshuamiller)\
**Post date:** [January 23, 2024, 10:46am UTC](https://community.hubspot.com/t/how-to-create-a-custom-field-for-modules/98409/2 "2024-01-23T10:46:46Z")

</div>

To add some futher information:  
Currently im fetching my modules and im Copy/Paste those fields.json into the other modules.  
So my question is: Is there a way to make those fields available as a preset, so i can choose the field like i choose a normal field like the text field.

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [January 23, 2024, 11:55am UTC](https://community.hubspot.com/t/how-to-create-a-custom-field-for-modules/98409/3 "2024-01-23T11:55:24Z")

</div>

@joshuamiller

In your choices, the value of the first choice is not declared correctly. Your value should be in double quotes like this “value” & and your .json should be like this:-

```lia-code-sample
{
 "label": "Spacing-Top",
 "name": "spacing_top",
 "type": "choice",
 "sortable": false,
 "display": "select",
 "choices": [
 [
 ",",
 "No Spacing"
 ],
 [
 "module-spacing-md-top",
 "Medium Spacing (5rem)"
 ],
 [
 "module-spacing-lg-top",
 "Large Spacing (7.5rem)"
 ]
 ],
 "default": "module-spacing-lg-top"
 }

```

And this is how it will show. ([CLICK HERE](https://prnt.sc/AiTbi8J2MSnJ))

You can’t create presets for your fields but there is also a choice field that you can use for the same purpose.

I hope this will help you out. Please mark it as **Solution Accepted and upvote** to help another Community member.  
Thanks!
