Show Hi! Welcome to The Data Are Alright, a blog about tips and tricks for changemakers. According to my stats, most of you found your way here through Google. I hope you enjoy the post below. If you’d like to stick around, here are a couple of great options to read. You can even SUBSCRIBE, which would absolutely make my day! (I post approx 3x / month)
Friends, a LOT of keys have been typed about the perils of using the field type “multi-select picklist” in Salesforce. But that’s not the point of this blog post, ok? Let’s say that using multi-select picklists are a type of harm reduction on the way to clean, reportable data. And that destination is really more of an iterative process anyway! In this blog post, I will introduce a Google Script that ANYONE can use to turn a “single-select” drop down menu (choose one) option into a “multi-select” (choose all that apply) option. I made improvements on the code presented here so that the results are aligned with the importing requirements for standard Salesforce data loaders. What is a multi-select picklist?Many spreadsheet and database tools/platforms allow you to configure restrictions for what types of data you can include in each cell or field. For example, when you are typing in an address, you might be accustomed to a dropdown menu that lists abbreviations for every state (apologies for the US-centric example). As a result, we can make sure that we don’t end up with some people typing PA and other people typing Pennsylvania (or a typo version of Pennsylvania), rendering our data somewhat useless (unless the use is, how many different ways can someone spell Pennsylvania?) So. “Single select” “picklists” are very useful!
Then there are picklists that go even farther with the selection opportunities. Why just pick one topping on your ice cream sundae when you want to choose ALL of your favorites? That’s where multi-select picklists come into play! Sure, they have some limitations and sure there are workarounds (like this and this), but IMO they are here to stay. More discussion (as well as the source for the image above) available hereOne of the main issues with MSPLs is data manipulation, aka filtering, grouping, updating, visualizing, etc. I agree, it’s a big problem. Especially for moving data from non-Salesforce systems into Salesforce. Migrating data to custom objects (let alone training users on this, albeit a bit easier now with Screen Flows, but that’s a tangent for another time) is so so much more difficult than just moving the clean data into an already-existing MSPL, for crying out loud! Dealing with data in SpreadsheetsI like to say that spreadsheets are the building blocks of databases – Salesforce and basically every other one out there. Run a report? Spreadsheet. Need to upload data? Spreadsheet. Etc etc etc. And when I am helping someone move data into Salesforce for the very first time, well, there’s a lot of spreadsheet data cleaning that has to happen. In one recent example, I combined contact data from three different sources (email newsletter, Google contact list, and donation payment processor). One of those sources had an MSPL already and we wanted to retain the options that were pre-selected while allowing relationship experts to UPDATE the data and add/remove values before moving the whole kit and kaboodle into Salesforce. I wanted to help them do that in Google Sheets, but the standard Google Sheets functionality only lets you have drop-down menus with one result. I decided that I had 4 options ahead of me:
If you’ve made it this far, you’re probably interested in #4, which is exactly what I did! Introducing Google ScriptsMost of the common explanations for Google Scripts made my eyes glaze over. So let me explain the best way I know how… with examples! Google Scripting is a feature that lets you use code to create formulas that Google Sheets doesn’t automatically have. I think it can also do other things, but I haven’t needed those things (yet). Luckily for us, Google Sheets already has a LOT of formulas (like Add, Subtract, Average, VLOOKUP, etc). One time I needed a formula that counts the number of tabs in a Google Sheets workbook. There’s no out-of-the-box formula for this, but it turns out that you can do it pretty easily with a Script! That kind of tinkering is also what made me curious about adding MSPLs to my Google Sheet for the purpose of staging data before moving it into Salesforce. CodeMy solution borrows extensively from the good folks at Spreadsheet Point. When you use this code, be sure to update the columns and the name of the Active Sheet (line 6 below) Steps
Limitations
Back to YOU!Thanks for getting this far in a technical blog post! If you are a Salesforce admin dealing with multi-select picklists, I’d love to hear from you. How do you handle exporting and importing data? Do you have access to Google Sheets at your org? Do you want to (or have you already) tried this solution? Please don’t be shy about writing back. Your comments *absolutely* make my day! How do I create a dropCreate a drop-down list. Open a spreadsheet in Google Sheets.. Select the cell or cells where you want to create a drop-down list.. Click Data. ... . Next to "Criteria," choose an option: ... . The cells will have a Down arrow. ... . If you enter data in a cell that doesn't match an item on the list, you'll see a warning. ... . Click Save.. Can a dropWhen you create a drop-down list, you can only make one selection. If you select another item, the first one is replaced with the new selection. He wanted to make multiple selections from the same drop down in such a way that the selections get added to the already present value in the cell.
How do I select multiple selections in dropdown?Selecting multiple options vary in different operating systems and browsers: For windows: Hold down the control (ctrl) button to select multiple options. For Mac: Hold down the command button to select multiple options.
How can you select multiple items in a multi selection list?These options work on Windows and Macintosh and are not specific to ConfTool but work in many applications. Hold the CTRL key and click the items in a list to choose them. Click all the items you want to select. They don't have to be next to each other.
|