# Smart Field Search

**URL:** <https://community.forestadmin.com/t/smart-field-search/238>\
**Category:** Help me!\
**Created:** [May 18, 2020, 11:26pm UTC](https://community.forestadmin.com/t/smart-field-search/238 "2020-05-18T23:26:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_Vargas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jose_vargas/32/128_2.png) [@Jose\_Vargas](https://community.forestadmin.com/u/Jose_Vargas)\
**Post date:** [May 18, 2020, 11:26pm UTC](https://community.forestadmin.com/t/smart-field-search/238/1 "2020-05-18T23:26:46Z")

</div>

I can’t get async search for a smart field.

The code below worked well.

```javascript
search: async (query, search) => {
        const searchCondition = { id: 11 };
        query.where[Sequelize.Op.and][0][Sequelize.Op.or].push(searchCondition);
        return query;
}

```

But it didn’t work for me when I added the code for delaying.

```javascript
search: async (query, search) => {
        await new Promise(resolve => {
          setTimeout(resolve, 10);
        });

        const searchCondition = { id: 11 };
        query.where[Sequelize.Op.and][0][Sequelize.Op.or].push(searchCondition);
        return query;
}

```

---

<div class="post-metadata">

**Author:** ![Arnaud\_Moncel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud_moncel/32/24_2.png) [@Arnaud\_Moncel](https://community.forestadmin.com/u/Arnaud_Moncel)\
**Post date:** [May 19, 2020, 9:33am UTC](https://community.forestadmin.com/t/smart-field-search/238/2 "2020-05-19T09:33:45Z")

</div>

Hi @Jose_Vargas welcom to our community 👋 and thank you to use Forest Admin.  
I don’t know what do you want to do, but have a look on this documentation [https://docs.forestadmin.com/woodshop/how-tos/search-on-a-smart-field-with-joints](https://docs.forestadmin.com/woodshop/how-tos/search-on-a-smart-field-with-joints), maybe should be help.  
Let me know.

---

<div class="post-metadata">

**Author:** ![Jose\_Vargas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jose_vargas/32/128_2.png) [@Jose\_Vargas](https://community.forestadmin.com/u/Jose_Vargas)\
**Post date:** [May 20, 2020, 3:48pm UTC](https://community.forestadmin.com/t/smart-field-search/238/3 "2020-05-20T15:48:53Z")

</div>

Thank you for your help @Arnaud_Moncel.

I saw that search supports a promise as a result in the documentation ([https://docs.forestadmin.com/documentation/reference-guide/fields/create-and-manage-smart-fields](https://docs.forestadmin.com/documentation/reference-guide/fields/create-and-manage-smart-fields)) and just wanted to do some extra works in the search, but it didn’t work for me.

But search-on-a-smart-field-with-joints works for me now.

Thank you!

---

<div class="post-metadata">

**Author:** ![rap2h](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/rap2h/32/25_2.png) [@rap2h](https://community.forestadmin.com/u/rap2h)\
**Post date:** [May 22, 2020, 9:02am UTC](https://community.forestadmin.com/t/smart-field-search/238/4 "2020-05-22T09:02:51Z")

</div>

Hi @Jose_Vargas,

This was a misleading information 🤭, the documentation [has been fixed](https://docs.forestadmin.com/documentation/reference-guide/fields/create-and-manage-smart-fields#searching-sorting-and-filtering-on-a-smart-field) ≈30 minutes ago thanks to your feedback! 🙏
