# How do you predefine an Enum/dropdown?

**URL:** <https://forum.makecode.com/t/how-do-you-predefine-an-enum-dropdown/26054>\
**Category:** Help\
**Tags:** extension\
**Created:** [January 17, 2024, 6:18pm UTC](https://forum.makecode.com/t/how-do-you-predefine-an-enum-dropdown/26054 "2024-01-17T18:18:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ARandomGuyOnMakeCode](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/arandomguyonmakecode/32/22983_2.png) [@ARandomGuyOnMakeCode](https://forum.makecode.com/u/ARandomGuyOnMakeCode)\
**Post date:** [January 17, 2024, 6:18pm UTC](https://forum.makecode.com/t/how-do-you-predefine-an-enum-dropdown/26054/1 "2024-01-17T18:18:15Z")

</div>

How do you predefine an Enum/dropdown parameter in a custom block? If it’s even possible.

For the people who don’t know what I’m talking about here is an example:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/c/c69a6e9cca1ef76587286f9630862c2af6bbc57a.png)  
 ![Screenshot 2024-01-13 115930](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/7416f423a7cce4dba43da1de310bad521a14a643.png)

All help is appreciated 🙂.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [January 17, 2024, 6:22pm UTC](https://forum.makecode.com/t/how-do-you-predefine-an-enum-dropdown/26054/2 "2024-01-17T18:22:03Z")

</div>

@ARandomGuyOnMakeCode you can do it two ways:

1. the default is the first item in the enum, so you can just move it  
in the enum to the first spot
2. you can use `param.defl="MyEnum.Value"`. here’s an example:

```auto
enum MyEnum {
    //% block="one"
    One,
    //% block="two"
    Two
}

/**
 * Custom blocks
 */
//% weight=100 color=#0fbc11 icon=""
namespace custom {
    //% blockId=my_custom_block_id
    //% block="here's an enum $value"
    //% value.defl=MyEnum.Two
    export function foo(value: MyEnum): void {
    }
}

```

---

<div class="post-metadata">

**Author:** ![ARandomGuyOnMakeCode](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/arandomguyonmakecode/32/22983_2.png) [@ARandomGuyOnMakeCode](https://forum.makecode.com/u/ARandomGuyOnMakeCode)\
**Post date:** [January 17, 2024, 10:02pm UTC](https://forum.makecode.com/t/how-do-you-predefine-an-enum-dropdown/26054/3 "2024-01-17T22:02:32Z")

</div>

Thank you for the information. Much appreciated 🙂.
