function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

web-to-lead picklist multiple values

I have a problem with the values of a picklist (with multiple values selection). I'm using the Web-To-Lead code to create the leads in SF but not in real-time, I 'm using a batch process where I load all leads from my website and run the SF applet to create the lead for each of them. So to pass the values to salesforce I'm using UploadValues. I'm creating the leads with no problem, everything is working ok but I have a field which is a picklist with multiple selection and this value is not going there in the correct format. How do I send multiple values? I'm using ";" to separate the values that I have but it doesn't work. It send the a string "value1;value2;..." but salesforce take this literally as it was one value and it even cuts the text to 40 characters (this is the limitation they explain in the documentation)

When I run the form directly I don't have problem passing these multiple values since the SF applet is reading directly from the <select> control

I hope you can help me with this.



Just in case I test that I'm passing the complete values for the picklist and it's ok. When I see the values I send for the picklist field I see "value1; value2; ....; valueN", It's within SF that the string is taken in a wrong way. First it cuts the string to the first 40 characters and then it takes that new string as just one value for the picklist. It doesn't split the values in one or more according to the character separator ';'
Please any help or idea is welcomed!
As its Web 2 Lead, you should be emulating what an HTML form does, which i think in this case would be to have multiple parameters with the same name and a value. THis is nothing to do with the API, so the ; separated list isn't going to work.
Is there any reason why you're trying to progamatically use Web 2 Lead, instead of using the real API, seems like that would be more suited to your particular use case.
We have Professional Edition. I think API is not available within this edition. So I have to find a way to create the leads using the Web2Lead code in a batch process.
I tried to use WebRequest to invoke the page with the form so the values will be sent directly from a form, but the WebRequest doesn't execute the javascipt I included to submit the form immediately after I load the lead's'information.
Now I'm trying to use UploadValues and NameValueCollection to send the values to the URI: and it kind of worked but now I have the problem with the picklist with multiple values.
Is there any solution for this without getting the Enterprise Edition to have access to API? The whole problem is that I don't need to run the SF servlet in realtime when users fill out the form because we collect visitor history that we want to send as part of the lead information. So, I already collect information in our website, and what I want to do is sent a group of leads information within an interval of time (which will include part of the visitor history information we need). That's why I have to create the batch process to collect all leads and then execute the servlet per each lead.
I don't know what else to do or how to solve this in a different way.
See my earlier post about having multiple values with the same name and the different values. The other thing to do would be to compare the generated request from a regular HTML form that does this against your programatically generated request and see what the differences are.


Based on the date of your posting you've probably moved on from this problem but I just wanted to post my solution in case someone else out there is Googling with the same issue.

The problem is that when you submit multiple checkbox values via script (Coldfusion, PHP, .NET, etc) that they are usually concatenated into a single value. 

For example, if you have:

<input name="myfield" type="checkbox" value="value1">

<input name="myfield" type="checkbox" value="value2">

<input name="myfield" type="checkbox" value="value3">


The Web-To-Lead servlet interpets this as a single value and receives:


(You'll see this if you send a hidden field with the name debug and a value of 1)

SFDC doesn't recognize the comma as a delimiter and so you don't get what you expect.  What makes it even more confusing is that the multipicklist values in your SFDC app display delimited by semi-colons!

Instead you need to send over:




This did the trick.  So whenever I encounter a multipicklist I just loop through the comma delimited values and send the values individually.

Hope that helps!


This is an older post, but I thought I would update in case anyone else is looking for the code like I was.

To make a Multiselct hidden field, use the following code and separate your values with semicolons.  Also include extra "multiple" attribute.
More than one hidden value:
<input  multiple="multiple" name="00No000000xxxxx" type="hidden" title="letters" value="aaa; bbb">

User-added image

If you are only submitting one value from your picklist, the field can be formatted in the web-to-lead code like a regular picklist.
Just on hidden value: 
<input type=hidden name="00NG000000xxxxx" title="letters" value="aaa">
User-added image

A comma instead of a semicolon will inaccurately create a new picklist values.
<input  multiple="multiple" name="00No000000xxxxx" type="hidden" title="letters" value="aaa, bbb">
User-added image