# Having issues with five.executeQuery

**URL:** <https://www.five.org/t/having-issues-with-five-executequery/178>\
**Category:** Support\
**Created:** [May 22, 2023, 10:54pm UTC](https://www.five.org/t/having-issues-with-five-executequery/178 "2023-05-22T22:54:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nebiyu](https://yyz2.discourse-cdn.com/flex030/user_avatar/www.five.org/nebiyu/32/162_2.png) [@nebiyu](https://www.five.org/u/nebiyu)\
**Post date:** [May 22, 2023, 10:54pm UTC](https://www.five.org/t/having-issues-with-five-executequery/178/1 "2023-05-22T22:54:11Z")

</div>

I was working on my project for the hackathon but I’m facing an issue with something here. Specifically, the five.executeQuery method is not working for me. For context, I’m trying to use it like this:  
const response = five.executeQuery(sql, 1, leadsId);  
I get the error: “executeQuery is not a function”. There are no typos or anything. This code is attached to the event of a form action button.

---

<div class="post-metadata">

**Author:** ![Jo-Anne](https://yyz2.discourse-cdn.com/flex030/user_avatar/www.five.org/jo-anne/32/45_2.png) [@Jo-Anne](https://www.five.org/u/Jo-Anne)\
**Post date:** [May 23, 2023, 6:20am UTC](https://www.five.org/t/having-issues-with-five-executequery/178/2 "2023-05-23T06:20:00Z")

</div>

Hi nebiyu,

The executeQuery() function is a function that is available on the backend only. You will notice in Five there are two types of events: Do and On. Do events execute on the backend and On events execute in the frontend. Do you have your function attached to an On event? Could you please try attaching it to the Do Press event. Refer to the below image.

  

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/five/original/1X/da57fdc25d3cc75a75297ca38d880d8157379f3f.png)

  

For additional information I have provided two links below on the API documentation and function examples for the executeQuery() function.

  

> **[executeQuery() | Five | Low-Code For Real Developers](https://help.five.org/2.1/docs/api/five/functions/execute-query/)**
>
> Last updated 13/07/2022

> **[executeQuery() | Five | Low-Code For Real Developers](https://help.five.org/2.1/docs/api-examples/function-examples/execute-query/)**
>
> Last updated 13/07/2022

---

<div class="post-metadata">

**Author:** ![nebiyu](https://yyz2.discourse-cdn.com/flex030/user_avatar/www.five.org/nebiyu/32/162_2.png) [@nebiyu](https://www.five.org/u/nebiyu)\
**Post date:** [May 23, 2023, 3:29pm UTC](https://www.five.org/t/having-issues-with-five-executequery/178/3 "2023-05-23T15:29:39Z")

</div>

Oh ok, now it’s working. Thank you! I didn’t know the difference between on and do.

Thanks once again!

---

<div class="post-metadata">

**Author:** ![Jo-Anne](https://yyz2.discourse-cdn.com/flex030/user_avatar/www.five.org/jo-anne/32/45_2.png) [@Jo-Anne](https://www.five.org/u/Jo-Anne)\
**Post date:** [May 23, 2023, 8:15pm UTC](https://www.five.org/t/having-issues-with-five-executequery/178/4 "2023-05-23T20:15:42Z")

</div>

No worries, and great that it is working for you now!
