# Problem with Form module

**URL:** <https://community.hubspot.com/t/problem-with-form-module/152359>\
**Category:** CMS Development\
**Tags:** enterprise\
**Created:** [July 7, 2026, 3:01pm UTC](https://community.hubspot.com/t/problem-with-form-module/152359 "2026-07-07T15:01:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MBaldoni](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mbaldoni/32/225525_2.png) [@MBaldoni](https://community.hubspot.com/u/MBaldoni)\
**Post date:** [July 7, 2026, 3:01pm UTC](https://community.hubspot.com/t/problem-with-form-module/152359/1 "2026-07-07T15:01:21Z")

</div>

I’m having trouble embedding a form module in hubspot.  
I would like to override the notifications email of the form like this

```auto
{% module_block form "my_form" form_to_use="{{ module.form_field.form_id }}", notifications_are_overridden=True, label="Form", overrideable=True %} {% module_attribute "notifications_override_email_addresses" is_json=True %} ["test@test.it"] {% end_module_attribute %} {% end_module_block %}

```

Like this it works, but I don’t want to put “test@test.it”, but I want to take the emails form an hubdb with some logic.  
I tried with a simple list of strings: `{% set emails = ["test1@test.it","test2@test.it"] %}`  
and then pass it to the attribute module like this: `{{ emails|tojson }}` which should print exactly `["test1@test.it","test2@test.it"]`.

But the emails don’t arrive. What am I missing?

---

<div class="post-metadata">

**Author:** ![stassey](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stassey/32/36_2.png) [@stassey](https://community.hubspot.com/u/stassey)\
**Post date:** [July 7, 2026, 6:12pm UTC](https://community.hubspot.com/t/problem-with-form-module/152359/3 "2026-07-07T18:12:29Z")

</div>

Hey @MBaldoni,

Thanks for bringing this to the Community!

Here are a couple of resources that could point you in the right direction: **[HubL standard tags - Form](https://developers.hubspot.com/docs/cms/reference/hubl/tags/standard-tags#form)** and **[Block syntax](https://developers.hubspot.com/docs/cms/reference/modules/using-modules-in-templates#block-syntax)**.

In the meantime, I’d also like to tag in some of our Contributors to see if they have any tips and tricks on this!

Hey @UlianaV, @evaldas, @MichaelMa – Do you have any suggestions for @MBaldoni on this?

Thank you!!

Sam, Community Manager

---

<div class="post-metadata">

**Author:** ![CarolinaDeMares](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/carolinademares/32/22707_2.png) [@CarolinaDeMares](https://community.hubspot.com/u/CarolinaDeMares)\
**Post date:** [July 7, 2026, 7:44pm UTC](https://community.hubspot.com/t/problem-with-form-module/152359/4 "2026-07-07T19:44:49Z")

</div>

Hi @MBaldoni!

The issue is likely that Module attribute expects a static JSON value at compile time, and it doesn’t always evaluate HubL variables or expressions the way you’d expect inside the block.

Although `{{ emails|tojson }}` renders the correct JSON when output on the page, it isn’t necessarily interpreted as the value for `notifications_override_email_addresses` within the module definition.

A couple of things you could try:

- Verify that your `emails` variable is actually being rendered as valid JSON by temporarily outputting `{{ emails|tojson }}` elsewhere in the template.
- If you’re pulling the emails from HubDB, make sure you’re ending up with an array of strings (not objects or a comma-separated string).
- If the rendered JSON is correct but notifications still aren’t sent, it may simply be a limitation of the `module_attribute` tag, which doesn’t currently support dynamically generated values for `notifications_override_email_addresses`.

As far as I know, the notification override is intended to be configured with a static value. If your use case requires the recipients to be determined dynamically from HubDB or other runtime logic, that isn’t currently supported through the form module.

I’m curious to see if anyone else has found a workaround, but based on the documentation and my experience, this appears to be a current limitation rather than an issue with your JSON formatting.

---

<div class="post-metadata">

**Author:** ![danielsinewe](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/danielsinewe/32/20100_2.png) [@danielsinewe](https://community.hubspot.com/u/danielsinewe)\
**Post date:** [July 8, 2026, 5:42am UTC](https://community.hubspot.com/t/problem-with-form-module/152359/5 "2026-07-08T05:42:32Z")

</div>

I would not make the form module notification override the dynamic part here.

The static JSON works because the form module can read that value as module configuration. Once the recipients come from HubDB logic, you are depending on a runtime HubL expression being interpreted as the module attribute value, and that is the fragile part.

The cleaner pattern is:

1. Keep the form notification config static or empty.
2. Add a hidden field with the routing key you already know on the CMS page, for example region, office, product, or HubDB row id.
3. After submission, use a workflow branch or custom-code action to send the internal notification to the right people.

If you still want to test the current approach, output the final value next to the form temporarily and make sure it is an actual JSON array of email strings with no empty HubDB rows. But even if that renders correctly, I would treat workflow/custom-code routing as the safer production setup.

---

<div class="post-metadata">

**Author:** ![MBaldoni](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mbaldoni/32/225525_2.png) [@MBaldoni](https://community.hubspot.com/u/MBaldoni)\
**Post date:** [July 8, 2026, 8:46am UTC](https://community.hubspot.com/t/problem-with-form-module/152359/6 "2026-07-08T08:46:07Z")

</div>

Hi,

thank you all for the support, I found a solution and the problem was indeed that the json wasn’t compiled in time. So before the json could be compiled the form was, so to the form was passed literally `{{ emails|tojson }}` instead of my compiled json. I also tried with `|render` filter but was unsuccesfull.  
The solution, which works, suggested by HubSpot DOC AI is the following:

```auto
{% set email_override_block = '{% module_attribute "notifications_override_email_addresses" is_json=True %}' ~ matchingNotificationEmails|tojson ~ '{% end_module_attribute %}' %}

{% module_block form "my_form" form_to_use="{{ module.form_field.form_id }}", notifications_are_overridden=True, label="Form", overrideable=True %} 
  {{ email_override_block }}
{% end_module_block %}

```

---

<div class="post-metadata">

**Author:** ![MBaldoni](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mbaldoni/32/225525_2.png) [@MBaldoni](https://community.hubspot.com/u/MBaldoni)\
**Post date:** [July 8, 2026, 8:48am UTC](https://community.hubspot.com/t/problem-with-form-module/152359/7 "2026-07-08T08:48:54Z")

</div>

Thank you for the suggestion, that would be a clean solution, but it would rely on external parts, which I was trying to avoid
