# Is it possible to show list of all possible values in dropdown when using Smart Action's form field with "reference"

**URL:** <https://community.forestadmin.com/t/is-it-possible-to-show-list-of-all-possible-values-in-dropdown-when-using-smart-actions-form-field-with-reference/550>\
**Category:** Help me!\
**Tags:** howtos\
**Created:** [June 29, 2020, 12:22pm UTC](https://community.forestadmin.com/t/is-it-possible-to-show-list-of-all-possible-values-in-dropdown-when-using-smart-actions-form-field-with-reference/550 "2020-06-29T12:22:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shriram\_Balakrishnan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shriram_balakrishnan/32/424_2.png) [@Shriram\_Balakrishnan](https://community.forestadmin.com/u/Shriram_Balakrishnan)\
**Post date:** [June 29, 2020, 12:22pm UTC](https://community.forestadmin.com/t/is-it-possible-to-show-list-of-all-possible-values-in-dropdown-when-using-smart-actions-form-field-with-reference/550/1 "2020-06-29T12:22:02Z")

</div>

Let’s take the following case:

```javascript
actions: [{
    name: 'Create Post',
    fields: [{
      field: 'user',
      reference: "users.id",
      isRequired: true
    }]
}]

```

## Expected behavior

In Smart Action, when I set a field with `reference: users.id`, then the options for this field are shown only when I start typing something on this user field. That is, only after querying I am getting the list of users.

Is it possible to get the list of users during form load itself and display it in a dropdown so that searching can be avoided?

## Actual behavior

As mentioned above, only when I start typing something the users are getting queried and shown in the form.

## Failure Logs

None

---

<div class="post-metadata">

**Author:** ![anon94532230](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon94532230](https://community.forestadmin.com/u/anon94532230)\
**Post date:** [June 29, 2020, 1:00pm UTC](https://community.forestadmin.com/t/is-it-possible-to-show-list-of-all-possible-values-in-dropdown-when-using-smart-actions-form-field-with-reference/550/2 "2020-06-29T13:00:13Z")

</div>

Hi @Shriram_Balakrishnan !  
Can you share a video (via [loom](https://www.loom.com/) for example) of your smart action so I can better understand what it is you are trying to accomplish ?

---

<div class="post-metadata">

**Author:** ![arnaud](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud/32/32_2.png) [@arnaud](https://community.forestadmin.com/u/arnaud)\
**Post date:** [June 29, 2020, 1:59pm UTC](https://community.forestadmin.com/t/is-it-possible-to-show-list-of-all-possible-values-in-dropdown-when-using-smart-actions-form-field-with-reference/550/3 "2020-06-29T13:59:35Z")

</div>

Hi @Shriram_Balakrishnan,

Did you try to set a dropdown widget doing so:

```javascript
actions: [{
    name: 'Create Post',
    fields: [{
      field: 'user',
      reference: "users.id",
      isRequired: true,
      widget: 'dropdown'   
  }]
}]

```

---

<div class="post-metadata">

**Author:** ![Shriram\_Balakrishnan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shriram_balakrishnan/32/424_2.png) [@Shriram\_Balakrishnan](https://community.forestadmin.com/u/Shriram_Balakrishnan)\
**Post date:** [June 29, 2020, 2:27pm UTC](https://community.forestadmin.com/t/is-it-possible-to-show-list-of-all-possible-values-in-dropdown-when-using-smart-actions-form-field-with-reference/550/4 "2020-06-29T14:27:11Z")

</div>

Hi @arnaud,

I tried this now for Subject field in my form. But the form breaks.Here is the screenshot.

 ![Screenshot 2020-06-29 at 7.52.43 PM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/1X/8e2d4cd5cb8244461ecb2d8078190d3bdbb55516.png)

And I am getting JS error in the console.

```javascript
vendor-8c57d7a635cd94d11cc3787ed4a841dd.js:24960 TypeError: Cannot read property 'get' of undefined
    at n.isFeatureCompatible (client-34db568df823589eccb7aa0fccb83857.js:6324)
    at n.initializeQueryParams (client-34db568df823589eccb7aa0fccb83857.js:4524)
    at n.init (client-34db568df823589eccb7aa0fccb83857.js:4522)
    at n [as init] (vendor-8c57d7a635cd94d11cc3787ed4a841dd.js:3462)
    at g (vendor-8c57d7a635cd94d11cc3787ed4a841dd.js:3367)
    at Function.e.create (vendor-8c57d7a635cd94d11cc3787ed4a841dd.js:3379)
    at e.n.create (vendor-8c57d7a635cd94d11cc3787ed4a841dd.js:1806)
    at r.i.create (vendor-8c57d7a635cd94d11cc3787ed4a841dd.js:2158)
    at Object.evaluate (vendor-8c57d7a635cd94d11cc3787ed4a841dd.js:4519)
    at e.t.evaluate (vendor-8c57d7a635cd94d11cc3787ed4a841dd.js:4373)

```

Please note that I am using Smart Action’s fields here.

Context:

- Package Version: 6.2.1
- Express Version: 4.16.4
- Sequelize Version: 5.15.2
- Database Version: MySQL 5.7
- Project Name: xs-library

---

<div class="post-metadata">

**Author:** ![arnaud](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud/32/32_2.png) [@arnaud](https://community.forestadmin.com/u/arnaud)\
**Post date:** [June 29, 2020, 2:43pm UTC](https://community.forestadmin.com/t/is-it-possible-to-show-list-of-all-possible-values-in-dropdown-when-using-smart-actions-form-field-with-reference/550/5 "2020-06-29T14:43:18Z")

</div>

My bad @Shriram_Balakrishnan,

This is what you need:

```javascript
actions: [{
    name: 'Create Post',
    fields: [{
      field: 'user',
      reference: "users.id",
      isRequired: true,
      widget: 'belongsto select'   
  }]
}]

```

---

<div class="post-metadata">

**Author:** ![Shriram\_Balakrishnan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shriram_balakrishnan/32/424_2.png) [@Shriram\_Balakrishnan](https://community.forestadmin.com/u/Shriram_Balakrishnan)\
**Post date:** [June 29, 2020, 3:24pm UTC](https://community.forestadmin.com/t/is-it-possible-to-show-list-of-all-possible-values-in-dropdown-when-using-smart-actions-form-field-with-reference/550/6 "2020-06-29T15:24:12Z")

</div>

> [@arnaud](#):
>
> `widget: 'belongsto select'`

Works perfectly! Thanks for the quick response @arnaud

Also, can you update where these details are mentioned in the docs?

# Update1:

I have 2 questions:

1. Can you update where these details are mentioned in the docs?
2. Is it possible to have the select box typeable? If the drop down has a big list, it would be difficult to scroll and find the required element. So typeable select box (that helps in searching) will be of great help to the users.
