# Data Hooks Not Working

**URL:** <https://forum.wixstudio.com/t/data-hooks-not-working/15111>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [October 31, 2018, 2:49am UTC](https://forum.wixstudio.com/t/data-hooks-not-working/15111 "2018-10-31T02:49:31Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/patrick/32/971_2.png) [@patrick](https://forum.wixstudio.com/u/patrick)\
**Post date:** [October 31, 2018, 2:49am UTC](https://forum.wixstudio.com/t/data-hooks-not-working/15111/1 "2018-10-31T02:49:31Z")

</div>

So I have hooks that have worked for a while but now they are not working anymore. I have even adjusted the code to little to nothing with no results. The items are inserting but the hooks are not firing. Any thoughts? Below is the code I changed it to.

```javascript
export function MailingListFooter_beforeInsert(item, context) {
    item.title = "testing";
    item.lastName = "insert";
 return item;
}

```

#hooks #datahooks #notworking

---

<div class="post-metadata">

**Author:** ![noamca](https://avatars.discourse-cdn.com/v4/letter/n/8797f3/32.png) [@noamca](https://forum.wixstudio.com/u/noamca)\
**Post date:** [October 31, 2018, 9:47am UTC](https://forum.wixstudio.com/t/data-hooks-not-working/15111/2 "2018-10-31T09:47:18Z")

</div>

Hi Patrick,  
The code you pasted seems to be fine so the problem might be due to another issue.  
Please share the URL of your site or your editor so we can inspect your issue.

---

<div class="post-metadata">

**Author:** ![patrick](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/patrick/32/971_2.png) [@patrick](https://forum.wixstudio.com/u/patrick)\
**Post date:** [October 31, 2018, 10:55am UTC](https://forum.wixstudio.com/t/data-hooks-not-working/15111/3 "2018-10-31T10:55:33Z")

</div>

The url is [https://www.stchurch.org](https://www.stchurch.org) and its the form in the footer. i have changed some things in the code to try and find a bug somewhere with no success but excuse the messy code lol. Thank you.

---

<div class="post-metadata">

**Author:** ![\_or](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/_or/32/1004_2.png) [@\_or](https://forum.wixstudio.com/u/_or)\
**Post date:** [November 13, 2018, 2:23pm UTC](https://forum.wixstudio.com/t/data-hooks-not-working/15111/4 "2018-11-13T14:23:38Z")

</div>

Hi,  
I checked your site and it seems like your onClick event isn’t declared well, check out [this](https://support.wix.com/en/article/wix-code-how-to-react-to-user-actions-using-events) article about creating events and let me know how it works out for you.

---

<div class="post-metadata">

**Author:** ![patrick](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/patrick/32/971_2.png) [@patrick](https://forum.wixstudio.com/u/patrick)\
**Post date:** [November 13, 2018, 3:26pm UTC](https://forum.wixstudio.com/t/data-hooks-not-working/15111/5 "2018-11-13T15:26:34Z")

</div>

When the button is clicked, it adds to the database but the hooks never fire.

---

<div class="post-metadata">

**Author:** ![\_or](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/_or/32/1004_2.png) [@\_or](https://forum.wixstudio.com/u/_or)\
**Post date:** [November 25, 2018, 12:29pm UTC](https://forum.wixstudio.com/t/data-hooks-not-working/15111/6 "2018-11-25T12:29:15Z")

</div>

Hi,  
Your hook refers to the “mailing list footer” but when I submitted information to the form in the footer it was saved in the “salesLead” collection, in that case, your hook isn’t referring to the right collection.

---

<div class="post-metadata">

**Author:** ![patrick](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/patrick/32/971_2.png) [@patrick](https://forum.wixstudio.com/u/patrick)\
**Post date:** [November 25, 2018, 3:48pm UTC](https://forum.wixstudio.com/t/data-hooks-not-working/15111/7 "2018-11-25T15:48:00Z")

</div>

Yeah I know. I decided to change it since i needed it to work. The datahooks still arent working for the other database though.

---

<div class="post-metadata">

**Author:** ![peterjanderson672](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/peterjanderson672/32/8461_2.png) [@peterjanderson672](https://forum.wixstudio.com/u/peterjanderson672)\
**Post date:** [March 19, 2019, 8:02am UTC](https://forum.wixstudio.com/t/data-hooks-not-working/15111/8 "2019-03-19T08:02:24Z")

</div>

Yes I have started to see this problem (of a hook not firing on \_beforeInsert) just in the last few days. This must be a bug?

---

<div class="post-metadata">

**Author:** ![peterjanderson672](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/peterjanderson672/32/8461_2.png) [@peterjanderson672](https://forum.wixstudio.com/u/peterjanderson672)\
**Post date:** [March 19, 2019, 8:23am UTC](https://forum.wixstudio.com/t/data-hooks-not-working/15111/9 "2019-03-19T08:23:51Z")

</div>

Here is the code in the data hook. Works fine in Preview; does not work on the live site.

```javascript
export function TestDates_beforeInsert(item, context) {
    item.testDate = new Date()
 return item;
}

```

---

<div class="post-metadata">

**Author:** ![abearguelles](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/abearguelles/32/3601_2.png) [@abearguelles](https://forum.wixstudio.com/u/abearguelles)\
**Post date:** [March 20, 2019, 4:11am UTC](https://forum.wixstudio.com/t/data-hooks-not-working/15111/10 "2019-03-20T04:11:41Z")

</div>

My Data Hooks are not working! Seems like many people have the same issue

---

<div class="post-metadata">

**Author:** ![peterjanderson672](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/peterjanderson672/32/8461_2.png) [@peterjanderson672](https://forum.wixstudio.com/u/peterjanderson672)\
**Post date:** [March 20, 2019, 8:45am UTC](https://forum.wixstudio.com/t/data-hooks-not-working/15111/11 "2019-03-20T08:45:19Z")

</div>

I have spoken with Wix support. They say they cannot help because this is ‘not a simple issue’ and i must pay a ‘Wix Expert’ to look at the problem. Either the ‘Expert’ will tell me what I am doing wrong, or will agree there is a bug. If there is a bug, what do I do next?  
BTW this issue has only appeared for me in the last couple of weeks i would say.

---

<div class="post-metadata">

**Author:** ![gauravachra](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@gauravachra](https://forum.wixstudio.com/u/gauravachra)\
**Post date:** [August 10, 2019, 12:24pm UTC](https://forum.wixstudio.com/t/data-hooks-not-working/15111/12 "2019-08-10T12:24:20Z")

</div>

Having the same issue. It will work for some time, then if you make a change it will not working. It will keep showing the changes made previously. Even after you delete a hook, it will still work for some time!!.
