Problem/Motivation
When mapping a Webform Checkbox (single checkbox) to a HubSpot Checkbox. The values don't match, resulting in a HubSpot error: "This value wasn't passed to the Contact record. '1' isn't one of the allowed options." for that mapped particular property.
Steps to reproduce
- Create a Webform with a single checkbox, and another text input
- Create a HubSpot with a single checkbox, and another text input
- Adding the HubSpot handler and map the Webform to the HubSpot form, mapping the checkboxes together and the text input together
- Try to submit the form
- Check the submission on HubSpot. You'll notice that the text input value was sent, but the checkbox mapping displays an error: "
This value wasn't passed to the Contact record. '1' isn't one of the allowed options."
Proposed resolution
- Change the value type for a single checkbox when mapped, from 1 to "true" and from 0 to "false"
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | hubspot-checkbox-boolean-change-3212295-8.patch | 1.16 KB | mkrizaj |
| #3 | hubspot-3212295-checkbox-conversion.patch | 1.03 KB | abedajam |
Comments
Comment #2
Viktor-T commentedI can second that, the checkbox values are not being passed correctly, which makes the checkboxes unusable.
Comment #3
abedajam commentedAttached is a patch that checks the type of component and converts the checkbox value into
trueorfalseComment #4
mohammed j. razemComment #5
Viktor-T commentedapplied this patch, and mysteriously, the site is started to send out ~2k emails on each submission,
only one submission registered on the form and only one on the HubSpot side.
unsure about the cause yet.
Comment #6
mohammed j. razem@Viktor-T
Would you be able to send a sample codebase to reproduce?
Or can you provide steps to reproduce? You can also try the patch and module on simplytest.me
Comment #7
mkrizaj commented@abedajam Your patch doesn't work if the checkbox field is within the wizard page.
Might be good to fix this, because I am also getting "This value wasn't passed to the Contact record. '1' isn't one of the allowed options."
Comment #8
mkrizaj commentedI am attaching new patch which should work now.
Comment #11
richgerdesThanks for working this out. I've committed the patch from #8 to both 8.x-1.x and the new 3.x branch.