Pass multiple select values from your website to Salesforce.com

Apr 26 2010 Published by under Quick tips, Site design, Technote

If you’re integrating your website with Salesforce.com you may need to capture multiple select values. Unfortunately, Salesforce doesn’t accept an array of values (the way PHP sends multiple selects when a form is submitted) so it truncates the values it receives so only the first value gets through. I recently solved this issue when I was building a form for a client.

Salesforce needs a single

&var=val

pair for each of the values in the same select. So, we need to create something that looks like

&var=val1&var=val2&var=val3...

The php implode() function is very helpful here so we could just pass the array from the form to a php file and do something like

implode("&val=" $_POST['mySelect']);

It would be sensible to urlencode the values of the form data to make sure it arrives safely. So, we need to urlencode the values after they’ve been imploded. If we simply urlencode the array, we no longer have an array and it’s pretty useless.

To send data from the website to Salesforce, I pre-processed the data and sent the request ‘manually’ so my chain of events looked something like this:

Form on website >> php data manipulation >> php creation of POST >> Salesforce.com object

If you have any tips about integrating your website with Salesforce, please drop me a line.

Free professional website planning tool

If you’re planning a new website or an update to an existing site, its a good idea to think through what sections are going to be included and how the website’s going to grow over time. This used to be done with PostIt notes and a pen but the sparkly free service over at WriteMaps is so much easier and you don’t loose your afternoon’s work when the wind blows through the window!

Free website planning tool

Of course in this web 2.0 world its a free service, allows you to work collaboratively with your team and the interface is simple. Perfect!

Linkorama: WriteMaps

Improve site quality with free images

Aug 13 2008 Published by under Improving your site, Site design

If your site is looking a bit tired and perhaps rather dull, using a few images to break it up is a great idea. Typically, stock images can cost a lot to licence for online use, however a number of websites offer good quality stock images for free.

One of the most well known and a site I have used several times is Stock Exchange. The selection is good and the quality is certainly good enough for most projects especially if you spend a bit of time editing the images for your specific application. Make sure you check the licencing terms of any image you use as sometimes the photographer will require you to tell them where its being used (usually for interest sake more than anything else).

Another great source of images is searching through Creative Commons licenced shots. Flickr’s advanced search provides options towards the bottom of the form, for searching only those images which can be licensed (via Creative Commons) for use on your website.

Adwords advice