# //% shim=ENUM\_GET : Enums members coded in JavaScript view are not displayed as selected in block view

**URL:** <https://forum.makecode.com/t/shim-enum-get-enums-members-coded-in-javascript-view-are-not-displayed-as-selected-in-block-view/21734>\
**Category:** PXT\
**Created:** [August 7, 2023, 8:40pm UTC](https://forum.makecode.com/t/shim-enum-get-enums-members-coded-in-javascript-view-are-not-displayed-as-selected-in-block-view/21734 "2023-08-07T20:40:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jp-96](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jp-96/32/9893_2.png) [@jp-96](https://forum.makecode.com/u/jp-96)\
**Post date:** [August 7, 2023, 8:40pm UTC](https://forum.makecode.com/t/shim-enum-get-enums-members-coded-in-javascript-view-are-not-displayed-as-selected-in-block-view/21734/1 "2023-08-07T20:40:05Z")

</div>

[ **Creating enumerations with blocks**  
https://makecode.com/defining-blocks#creating-enumerations-with-blocks](https://makecode.com/defining-blocks#creating-enumerations-with-blocks)

**Playground example** : [Create Enums from Blocks](https://makecode.com/playground#language-create-enums)

Sample: Creating Enum  
Editor: micro:bit

# On Blocks editor

Place the blocks as follows:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/3/336f6c88f7f832884ed012a2e9882060bbf235b7.png)

**Member Red (=0) is not selected, but the display will be 0**

# JavaScript editor → Blocks editor

On the JavaScript editor, code as follows:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/f/f81b2340042769fa7689101160abb9e79bdd8fe6.png)

**When I convert to Blocks, it shows Red instead of Blue and nothing is selected.**

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/2/2deeb9bda227b18f811a9a9bbb03da5b046d7fbc.png)

However, since 1 is displayed on the simulator, it appears that Blue (=1) is selected internally.  
It appears that internal values are retained when blocks are copied.

It seems to be a display issue on the block.

---

<div class="post-metadata">

**Author:** ![jp-96](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jp-96/32/9893_2.png) [@jp-96](https://forum.makecode.com/u/jp-96)\
**Post date:** [August 30, 2023, 4:48pm UTC](https://forum.makecode.com/t/shim-enum-get-enums-members-coded-in-javascript-view-are-not-displayed-as-selected-in-block-view/21734/2 "2023-08-30T16:48:05Z")

</div>

**pull request**

> <https://github.com/microsoft/pxt/pull/9654>
>
> Data binding fails.
> https://github.com/microsoft/pxt/issues/9653
> 
> Console war…ning:
> Cannot set the dropdown's value to an unavailable option. Block type: radioMessageCode, Field name: MEMBER, Value: add1
