# Using form to add rows in HubDB table

**URL:** <https://community.hubspot.com/t/using-form-to-add-rows-in-hubdb-table/70227>\
**Category:** CMS Development\
**Created:** [November 30, 2022, 8:58am UTC](https://community.hubspot.com/t/using-form-to-add-rows-in-hubdb-table/70227 "2022-11-30T08:58:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![codenil](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@codenil](https://community.hubspot.com/u/codenil)\
**Post date:** [November 30, 2022, 8:58am UTC](https://community.hubspot.com/t/using-form-to-add-rows-in-hubdb-table/70227/1 "2022-11-30T08:58:20Z")

</div>

Hi, this is my first post here. And I plan to create a HubDB table with each row containing details of new job openings from our HR department. And from that, I want to create a set of dynamic pages - one for the list of all jobs and the individual detail pages for each job opening. From the docs and guide articles, I know how to do it. But my idea is to create a password-protected page for the HR personnel on which there will be a form to add new job posts (with fields reflecting data in each column of a new HubDB row). For this part, I am not finding any resource describing the process of storing the form submission data in my HubDB table. Please help with an example. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [November 30, 2022, 2:56pm UTC](https://community.hubspot.com/t/using-form-to-add-rows-in-hubdb-table/70227/2 "2022-11-30T14:56:25Z")

</div>

Hi @codenil,

you can create a custom module with a modified form embed code like this one

```lia-code-sample
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
 hbspt.forms.create({
 region: "na1",
 portalId: "{{ hub_id }}",
 formId: "{{ module.form_field.form_id }}",
			{# all further modifications come here #}
 });
</script>

```

add a form function to it (in this example I did not modify the name) and trigger the [HubDB API](https://developers.hubspot.com/docs/api/cms/hubdb) on an “onFormSubmitted” event

hope this helps.

btw - you can create [multilevel dynamic pages](https://developers.hubspot.com/docs/cms/guides/dynamic-pages/hubdb/multilevel)(listing, detail…) with HubDB

best,

Anton

---

<div class="post-metadata">

**Author:** ![codenil](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@codenil](https://community.hubspot.com/u/codenil)\
**Post date:** [January 13, 2023, 11:30pm UTC](https://community.hubspot.com/t/using-form-to-add-rows-in-hubdb-table/70227/3 "2023-01-13T23:30:33Z")

</div>

@Anton Thanks so much for the above details. I am a beginner in HubSpot, so I am asking this. I went to HubDB API docs, when I test an API, I do get the results on the API Docs section. But as I try to paste the Node code (that worked in test area) in my HubSpot Module, I get an error saying, “Uncaught ReferenceError: require is not defined”

Does this mean, I can not use the API call from the HubSpot module? Please help.

---

<div class="post-metadata">

**Author:** ![Online911](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/online911/32/203175_2.png) [@Online911](https://community.hubspot.com/u/Online911)\
**Post date:** [March 1, 2025, 6:59pm UTC](https://community.hubspot.com/t/using-form-to-add-rows-in-hubdb-table/70227/4 "2025-03-01T18:59:01Z")

</div>

how i can send data from website page form to row table?
