# Create an optional datatype from a normal one

**URL:** <https://forum.canton.network/t/create-an-optional-datatype-from-a-normal-one/7023>\
**Category:** App Development\
**Created:** [January 10, 2024, 7:55am UTC](https://forum.canton.network/t/create-an-optional-datatype-from-a-normal-one/7023 "2024-01-10T07:55:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Divyansh\_Gupta\_ATR10](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/divyansh_gupta_atr10/32/7045_2.png) [@Divyansh\_Gupta\_ATR10](https://forum.canton.network/u/Divyansh_Gupta_ATR10)\
**Post date:** [January 10, 2024, 7:55am UTC](https://forum.canton.network/t/create-an-optional-datatype-from-a-normal-one/7023/1 "2024-01-10T07:55:34Z")

</div>

I want to convert a data type into an optional Data type. I tried the following format:

```haskell
let newOptionalAdminId = Optional newAdminId

```

However, I am getting the following error with this

```haskell
    Data constructor not in scope:
      Optional : TalentId -> Optional TalentId

```

TalentId is the contract ID for the Template Talent. How can I convert this into an optional datatype?

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [January 10, 2024, 8:10am UTC](https://forum.canton.network/t/create-an-optional-datatype-from-a-normal-one/7023/2 "2024-01-10T08:10:40Z")

</div>

The constructor for this is called `Some`, so

```haskell
let newOptionalAdminId = Some newAdminId

```

Optional is just the name of the type.  
You might also be interested in the tutorial on Daml data types [Data Types — Daml SDK 2.8.0 documentation](https://docs.daml.com/daml/intro/3_Data.html#variants-and-pattern-matching) and the docs for Optional [Prelude — Daml SDK 2.8.0 documentation](https://docs.daml.com/daml/stdlib/Prelude.html#type-da-internal-prelude-optional-37153)
