.update() doesn't reflect any changes in collection

Hello,

I have a collection called “Resource Matching Sheet” that I’m trying to link to my Google Sheets/Forms such that whenever a modification is made/new row added, the collection would update itself.

I’m a beginner at wix code so I’m not sure why the changes are not reflected, I’m not sure where my error lies and where to start debugging. Is it my mapping done wrong? Or perhaps the update method is wrong? Maybe your trained eyes can catch it?

It’s also my first time reading through the velo api documentation, so sorry if I missed anything out! Any help/advice would be greatly greatly appreciated.

This is my updateRsm.jsw located in the backend:

import {fetch} from 'wix-fetch'; 

//get most updated json fields
export function getNewRsm() {
 const url = 'https://api.apispreadsheets . com/data/12741/'; //api for gsheets
    console.log("200");
 return fetch(url, {method: 'get'})
 .then(response => response.json())
}

This is on the front end, where my table is located and linked to the same database as the “Resource Matching Sheet” collection:

import wixData from 'wix-data';
import {getNewRsm} from 'backend/updateRsm.jsw';
 
$w.onReady(() => {

 let toUpdate = getNewRsm();
 
 wixData.update("ResourceMatchingSheet", toUpdate) 
  .then((results)=> {
   let item = results;
   })
  .catch((err)=> {
   let errorMsg = err;
   });
 });

Also! After some scrolling through multiple forums, I understand that Google Sheets may not be the best place to store my database but it’s what’s most convenient for the team for now! We’re a volunteer initiative so budget is tight. So I’ll stick to gsheets for now.

Why not use the built-in Wix database ? It doesn’t cost any extra to use. It will be much easier to develop and maintain than having to interface with an external database (Google sheet).

Integrating with Google Sheets is not a trivial task, but it can be done. See these examples:
Google Sheets Integration
Example: Google Sheets NPM