We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Nov 30, 2022 3:58 AM
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.
Solved! Go to Solution.
Nov 30, 2022 9:56 AM
Hi @codenil,
you can create a custom module with a modified form embed code like this one
<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 on an "onFormSubmitted" event
hope this helps.
btw - you can create multilevel dynamic pages(listing, detail...) with HubDB
best,
Anton
2 weeks ago
@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.
Nov 30, 2022 9:56 AM
Hi @codenil,
you can create a custom module with a modified form embed code like this one
<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 on an "onFormSubmitted" event
hope this helps.
btw - you can create multilevel dynamic pages(listing, detail...) with HubDB
best,
Anton