Change default "--None--" text be changed?

  • 2
  • Question
  • Updated 1 year ago
  • Answered
Is it possible to change the default "--None--" value (when you have a required field and enable the 'Add "None" option') to different text?  In our case, we would like to tell the user to select something ("Select..." for example) whereas "--None--" implies they selected "None" as their value.  This is especially confusing when the dropdown includes the value "None" as one of the options.

Maybe this can be done with labels / translations?

Thanks as always!

- Chris
Photo of Chris

Chris

  • 1,632 Points 1k badge 2x thumb

Posted 5 years ago

  • 2
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,262 Points 20k badge 2x thumb
Hi Chris,

This is possible several ways, depending on how widely you want this change to be applied. In both cases, you will be overriding the Custom Label "select_option_none" that Skuid is referencing internally.

(a) To apply it globally (across all Skuid Pages), you can use Translation Workbench to create a Local Translation/Override.
(b) To apply it locally (on a particular Skuid Page), you can use a JavaScript Resource of type Inline to overwrite the value for the custom label that Skuid loads in by default.

Either way, the effect is the same. Here for our example, we're replacing "--None--" with "Select an Option...":



Here is an explanation of how to do each of these strategies:

(a) Global override
  1. Enable Translation Workbench -- go to Setup > Translation Workbench, and click Enable.
  2. Add English as Language you want to Translate, and make yourself a Translator. (kind of weird, but this is how you do Local Overrides)
  3. Go to Setup > Custom Labels, and search for the label called "Select Option None" (API Name "Select_Option_None" in the Skuid package.
  4. Click to create a new Local Translation / Override.
  5. Select English as the Language, and then enter your text, e.g. "Select an Option...", for the Translation Text.
  6. Click Save.



(b) Local override
  1. Go to the Page Composer for the particular Skuid Page where you'd like this override to be made.
  2. Add a new JavaScript Resource.
  3. Set its type to "Inline" (NOT Inline Snippet!!)
  4. Enter the following for the Resource Body:
(function(skuid){   
   skuid.label.add({
      "select_option_none":"Select an Option..." 
   });
})(skuid);

5. Click Save.



Photo of Jack Sanford

Jack Sanford, Champion

  • 8,406 Points 5k badge 2x thumb
Zach, is there any way to do this on just one single field on a page? I want to change just a single field to "Prefer not to answer", which makes things awkward for some other picklists. 
Photo of Craig Rosenbaum

Craig Rosenbaum

  • 4,776 Points 4k badge 2x thumb
I am in need of the same thing.
Photo of Matt Sones

Matt Sones, Champion

  • 31,530 Points 20k badge 2x thumb
Has anyone found a way to do this for a single field?