How to set a String in a Option[String]? April 7, 2023 by Tarik You can also just use Option(myValue) which will convert null to None and non-null to Some.