Having issues with five.executeQuery

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.

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.

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

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

Thanks once again!

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

1 Like