Submit data to dataset without leaving the page

Hey, the only code used is the below which is placed in the backend / data.js

This is used calculate the users total points by summing the individual areas.

import wixData from ‘wix-data’ ;
export function NewUserData_afterQuery(item, context)
{
item.testSum = item.test1 + item.test2 + item.test3;
return item;}

And below is the button connection, I have to choose to link to another page in order for the points to submit to the dataset. Even if I link to the same page (refreshing the page) it doesn’t work.