# Reference field in SmartAction of type \['Enum'\]

**URL:** <https://community.forestadmin.com/t/reference-field-in-smartaction-of-type-enum/3009>\
**Category:** Help me!\
**Created:** [July 29, 2021, 12:14am UTC](https://community.forestadmin.com/t/reference-field-in-smartaction-of-type-enum/3009 "2021-07-29T00:14:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Roegiers](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/david_roegiers/32/1039_2.png) [@David\_Roegiers](https://community.forestadmin.com/u/David_Roegiers)\
**Post date:** [July 29, 2021, 12:14am UTC](https://community.forestadmin.com/t/reference-field-in-smartaction-of-type-enum/3009/1 "2021-07-29T00:14:35Z")

</div>

## Expected behavior

Field in SmartAction of type [‘Enum’] with reference. I want to select multiple records from another collection in the form of the SmartAction.

I don’t even know if that functionality is supported. Is it?

## Actual behavior

The browser freezes and the form remains half rendered.

## Failure Logs

```javascript
Uncaught TypeError: Cannot read property 'widget' of null
    at i.get (client-97dffa30a5d987a7e39579cd8bf227d9.js:13836)
    at vendor-c07624b566e0c950b81e97ff61b6e54f.js:2679
    at e.untrack (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5121)
    at i.o.get (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2679)
    at i.currentEditWidget (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2638)
    at i.get (client-97dffa30a5d987a7e39579cd8bf227d9.js:13838)
    at vendor-c07624b566e0c950b81e97ff61b6e54f.js:2679
    at e.untrack (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5121)
    at i.o.get (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2679)
    at i.componentName (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2638)
    at _e (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2655)
    at e.ye [as getPath] (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2654)
    at vendor-c07624b566e0c950b81e97ff61b6e54f.js:4368
    at e.track (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5119)
    at e.t.value (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4368)
    at e.t.initialize (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4337)
    at e.t.peek (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4333)
    at Object.evaluate (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4696)
    at e.t.evaluate (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4629)
    at e.t.evaluateSyscall (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4900)
    at e.t.evaluateInner (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4894)
    at e.t.evaluateOuter (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4894)
    at r.next (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4997)
    at r.execute (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4996)
    at n.r.handleException (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4915)
    at e.t.handleException (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4942)
    at e.r.throw (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4904)
    at n.evaluate (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4701)
    at e.r.execute (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4904)
    at e.t.rerender (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4945)
    at e.l.render (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2426)
    at vendor-c07624b566e0c950b81e97ff61b6e54f.js:2454
    at e.inTransaction (vendor-c07624b566e0c950b81e97ff61b6e54f.js:4410)
    at n.i._renderRoots (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2453)
    at n.i._renderRootsTransaction (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2458)
    at n.i._revalidate (vendor-c07624b566e0c950b81e97ff61b6e54f.js:2458)
    at t.invoke (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5286)
    at e.t.flush (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5278)
    at e.t.flush (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5292)
    at e.n._end (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5355)
    at e.n.end (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5311)
    at e.n._run (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5357)
    at e.n._join (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5356)
    at e.n.join (vendor-c07624b566e0c950b81e97ff61b6e54f.js:5322)
    at h (vendor-c07624b566e0c950b81e97ff61b6e54f.js:3927)
    at vendor-c07624b566e0c950b81e97ff61b6e54f.js:3627
    at a (vendor-c07624b566e0c950b81e97ff61b6e54f.js:3845)
    at Object.handleEvent (vendor-c07624b566e0c950b81e97ff61b6e54f.js:3627)
    at p.handleEvent (vendor-c07624b566e0c950b81e97ff61b6e54f.js:3552)
    at HTMLLIElement.<anonymous> (vendor-c07624b566e0c950b81e97ff61b6e54f.js:3577)

```

## Context

Please provide any relevant information about your setup.

- Package Version: NPM? 6.13.0
- Express Version: 4.17.1
- Sequelize Version:
- Database Dialect: Mongoose
- Database Version:
- Project Name: jurata

```javascript
    "body-parser": "1.19.0",
    "chalk": "~1.1.3",
    "cookie-parser": "1.4.4",
    "cors": "2.8.5",
    "debug": "~4.0.1",
    "dotenv": "~6.1.0",
    "express": "^4.17.0",
    "express-jwt": "5.3.1",
    "forest-express": "^7.4.0",
    "forest-express-mongoose": "^7.7.1",
    "mongoose": "~5.8.2",
    "morgan": "1.9.1",
    "require-all": "^3.0.0"

```

---

<div class="post-metadata">

**Author:** ![Guillaume\_Cisco](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaume_cisco/32/918_2.png) [@Guillaume\_Cisco](https://community.forestadmin.com/u/Guillaume_Cisco)\
**Post date:** [July 29, 2021, 9:33am UTC](https://community.forestadmin.com/t/reference-field-in-smartaction-of-type-enum/3009/2 "2021-07-29T09:33:06Z")

</div>

Hello @David_Roegiers !

Nice catch indeed! ⚾  
This is definitively a bug.  
It looks like it is currently not supported 🏗

We will handle it and tell you once it is fixed!

---

<div class="post-metadata">

**Author:** ![Guillaume\_Cisco](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaume_cisco/32/918_2.png) [@Guillaume\_Cisco](https://community.forestadmin.com/u/Guillaume_Cisco)\
**Post date:** [July 29, 2021, 9:45am UTC](https://community.forestadmin.com/t/reference-field-in-smartaction-of-type-enum/3009/3 "2021-07-29T09:45:57Z")

</div>

By the way, you can only put an array of strings in the `enums` key. Keep in mind, you won’t be able to see directly objects in the dropdown.

I hope it helps 😉

---

<div class="post-metadata">

**Author:** ![David\_Roegiers](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/david_roegiers/32/1039_2.png) [@David\_Roegiers](https://community.forestadmin.com/u/David_Roegiers)\
**Post date:** [July 29, 2021, 9:55am UTC](https://community.forestadmin.com/t/reference-field-in-smartaction-of-type-enum/3009/4 "2021-07-29T09:55:41Z")

</div>

Merci Guillaume 👋

Okay, right now I’m building a workaround with type [‘Enum’], strings without reference.

Will you get in touch here, when this gets released? Or is there an issue tracker I can observe?

---

<div class="post-metadata">

**Author:** ![Guillaume\_Cisco](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaume_cisco/32/918_2.png) [@Guillaume\_Cisco](https://community.forestadmin.com/u/Guillaume_Cisco)\
**Post date:** [July 29, 2021, 12:50pm UTC](https://community.forestadmin.com/t/reference-field-in-smartaction-of-type-enum/3009/5 "2021-07-29T12:50:43Z")

</div>

Regarding the way of supporting multiple records from another collection thanks to a dropdown list in a smart action form, I’m pushing it to our product board!

Thanks for digging into this 👍

---

<div class="post-metadata">

**Author:** ![David\_Roegiers](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/david_roegiers/32/1039_2.png) [@David\_Roegiers](https://community.forestadmin.com/u/David_Roegiers)\
**Post date:** [July 29, 2021, 2:37pm UTC](https://community.forestadmin.com/t/reference-field-in-smartaction-of-type-enum/3009/6 "2021-07-29T14:37:02Z")

</div>

> [@Guillaume\_Cisco](#):
>
> Regarding the way of supporting multiple records from another collection thanks to a dropdown list in a smart action form, I’m pushing it to our product board!

Just to be clear : this behaviour is possible by using the type [‘Enum’] and using RecordGetters in the hook. However, this is custom code, which needs maintaining and adds complexity to the overall solution. So, allowing the behaviour by simply using the reference field would be cool towards the future, but not a blocker in my project.
