I'm not sure if this is a bug or user error here. But I have a webform select list with 4 options. I have HubSpot field type of Checkboxes (Select multiple options).

When I submit my webform with more than one option, HubSpot only populates one of those choices. Am I missing something? Is this a bug?

Thanks for any help!

Comments

Anonymous’s picture

Assigned: Unassigned »

The HubSpot Forms API is not very clear on how this should work. As I did not test with multiple-choice fields I am unable to say if this is a bug or expected behavior.

I will do some testing on this and advise, hopefully tomorrow at the latest, on how this should be handled.

xpersonas’s picture

Assigned: » Unassigned

Thanks. I have a deadline Monday so I needed to be sure to get this done. It looks to me like it takes semi-colon separated values. I've modified your module like this...

      // $fields[$result] = $submission->data[$data_id]['value'][0];

      foreach($submission->data[$data_id]['value'] as $key => $value) {
        $fields[$result] .= $value . ';';
      }

      $fields[$result] = substr($fields[$result], 0, -1);

I've only tested this with textfields and select lists. But it's working for me. I figured I would send this your way. You may know a slicker way to do it, or know why that won't work for other field types.

Anonymous’s picture

Component: Documentation » Code
Assigned: Unassigned »
Category: support » bug
Status: Active » Closed (fixed)

You are correct. I came up with a similar solution myself which has just been committed as 7.x-2.0-rc4.