# Referencing another Model in smart action

**URL:** <https://community.forestadmin.com/t/referencing-another-model-in-smart-action/330>\
**Category:** Help me!\
**Tags:** howtos\
**Created:** [May 27, 2020, 8:53pm UTC](https://community.forestadmin.com/t/referencing-another-model-in-smart-action/330 "2020-05-27T20:53:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![remi\_okarito](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/remi_okarito/32/778_2.png) [@remi\_okarito](https://community.forestadmin.com/u/remi_okarito)\
**Post date:** [May 27, 2020, 8:53pm UTC](https://community.forestadmin.com/t/referencing-another-model-in-smart-action/330/1 "2020-05-27T20:53:14Z")

</div>

## Expected behavior

When declaring a smart action like this

```ruby
action '🎈 Invite a new user in this team', type: 'single', fields: [{
    field: 'Inviter email',
    description: 'Your Okarito name will show in the invite email',
    type: 'String',
    reference: 'Team.id',
    is_required: true
  },
  {
    field: 'New user email',
    type: 'String',
    is_required: true
  }]

```

I expect this field to accept typing and suggest Users emails

 ![Capture d’écran 2020-05-27 à 22.48.36](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/1X/0c70e00bfe26a692847d3bc31ccc689d4e4ee38e.png)

My User model setup in the UI (last checkbox is disabled)

 ![Capture d’écran 2020-05-27 à 22.50.46](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/1X/10ec1de8d2fca66db3152d4888ccdd4fd95421b2.png)

## Actual behavior

Field in the smart action is disabled.

## Context

Please provide any relevant information about your setup.

Rails Liana, Liana 3.3. Project okarito.

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [May 28, 2020, 6:41am UTC](https://community.forestadmin.com/t/referencing-another-model-in-smart-action/330/2 "2020-05-28T06:41:08Z")

</div>

Hi @remi_okarito and Welcome to the Forest Admin Community 🍾 !

To be able to search on record when editing, like in your case **you need the `Allow search to edit` to be enabled**.  
But what I think there is an issue in you action too, you should not be referencing `Team.id` but `User.id`. The `Team` will already be passed by checking a record in the table view.

**EDITED:**  
After reading your post again I see that the checkbox is disabled. This is an issue on the platform. You need to hide the collection on the left panel. Go to the settings and click on that checkbox (Allow search to edit) and save. Then you can show back the collection and it should work.

I hope that helps you 🙏

---

<div class="post-metadata">

**Author:** ![remi\_okarito](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/remi_okarito/32/778_2.png) [@remi\_okarito](https://community.forestadmin.com/u/remi_okarito)\
**Post date:** [May 28, 2020, 7:21am UTC](https://community.forestadmin.com/t/referencing-another-model-in-smart-action/330/3 "2020-05-28T07:21:54Z")

</div>

Hello @anon62739609 thank you for your quick feedback. Hiding and re-showing collection just worked

 ![Capture d’écran 2020-05-28 à 09.20.49](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/1X/7dfa5b88b11e4761bbe18ce50242b9d7b38e577a.png)

But… this is quite not very intuitive 😃

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [May 28, 2020, 8:58am UTC](https://community.forestadmin.com/t/referencing-another-model-in-smart-action/330/4 "2020-05-28T08:58:38Z")

</div>

Yeah. It was fixed today. It should normally not happen in the future 😄

---

<div class="post-metadata">

**Author:** ![thgaskell](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/thgaskell/32/832_2.png) [@thgaskell](https://community.forestadmin.com/u/thgaskell)\
**Post date:** [September 29, 2020, 2:59am UTC](https://community.forestadmin.com/t/referencing-another-model-in-smart-action/330/5 "2020-09-29T02:59:21Z")

</div>

> [@remi\_okarito](#):
>
> But… this is quite not very intuitive 😃

Thanks so much. I was about to ask for help for enabling the “Allow search to edit” checkbox. Apparently it’s only editable if the model is hidden 🙈
