How to create select option with null value

How to create select option with null value

rdmrdm Posts: 194Questions: 55Answers: 4

I have a scenario where the user can update a record field with a select list.

{
   label: "Course Ownership: Sets Own Targets", name: "FridayPlanning.CourseOwnershipSetsOwnTargets",
   type: "select", options: yesNoNullOptions 
  },

where:

var yesNoNullOptions = [{ label: "Blank", value: null }, { label: "No", value: "No" }, { label: "Yes", value: "Yes" }];

If the underlying value is "yes" or "no" the select list saves the correct value. Where I am having difficulty is if I select the "Blank" option. When blank is selected, I need the database value to be null instead of an empty string.

I just wanted to confirm that I'm not missing something obvious. Is it possible to save a value as null instead of as an empty string?

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.