We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

How do you change existing multi select option values?

How Do I?

User eywWYpJp's avatar
User eywWYpJp
6 posts
2 months ago
User eywWYpJp's avatar User eywWYpJp

We have a site with ~1k entries that use a few Multi Select fields. We’re using the Populate Manually option for the list of values for each. We have some changes we need to make to the options. Those options are stored in the db as the text of the option, and changing the option will result in an error if an entry is edited and the option is changed. Does anyone have a reliable way to change the options, and ideally the entries, without find and replace in the database?

       
User olbp8DKG's avatar
User olbp8DKG
4 posts
2 months ago
User olbp8DKG's avatar User olbp8DKG

Not per say but I’d look at adding a new field based on Value/Label pairs, get the new field populated, the switch over template tags.

       
User eywWYpJp's avatar
User eywWYpJp
6 posts
2 months ago
User eywWYpJp's avatar User eywWYpJp

does the Value / Label pairs have a similar issue? It seems if I keep the Value the same, I can change the label. But, does that become cumbersome or “disconnected” if things change a bit more significantly?

       
User qIVqDu27's avatar
User qIVqDu27
10 posts
2 months ago
User qIVqDu27's avatar User qIVqDu27

Man this seems like deja vu

       
User eywWYpJp's avatar
User eywWYpJp
6 posts
2 months ago
User eywWYpJp's avatar User eywWYpJp

was there a message i missed?

       
User qIVqDu27's avatar
User qIVqDu27
10 posts
2 months ago
User qIVqDu27's avatar User qIVqDu27

no I feel I’ve been faced w/ something similiar

       
User qIVqDu27's avatar
User qIVqDu27
10 posts
2 months ago
User qIVqDu27's avatar User qIVqDu27

so an option might be “NJ” (already stored in the database). And you need it to be “New Jersey”. ANd if you make that change, EE will complain because prior data has ‘NJ’ but you’ve just changed to “New Jersey” ?

       
User qIVqDu27's avatar
User qIVqDu27
10 posts
2 months ago
User qIVqDu27's avatar User qIVqDu27

(because you’re from there?)

       
User olbp8DKG's avatar
User olbp8DKG
4 posts
2 months ago
User olbp8DKG's avatar User olbp8DKG

Using value/label pairs you could keep the values the same but use any old label you want - you can change labels without affecting templates directly, if you use labels in templates they’ll simply output whats there in the front end and change if you modify them.

       
Hop Studios's avatar
Hop Studios
481 posts
2 months ago
Hop Studios's avatar Hop Studios

There are also two find-replace options in EE (as in you don’t have to do a database query). One is in utilities and the other is in Pro Search.

       
User eywWYpJp's avatar
User eywWYpJp
6 posts
2 months ago
User eywWYpJp's avatar User eywWYpJp

The Find and Replace works on multi select fields? Would I change the field first, or do the find and replace? (I can also test this out)

       
User eywWYpJp's avatar
User eywWYpJp
6 posts
2 months ago
User eywWYpJp's avatar User eywWYpJp

And thanks for the rec!

       
User eywWYpJp's avatar
User eywWYpJp
6 posts
2 months ago
User eywWYpJp's avatar User eywWYpJp

that worked perfectly, @hopstudios! thanks so much for the idea!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.