Hello, I would like to be able to use a text box on my Wix site to take text and update a cell on a Google Sheet. I am quite confident its possible by browsing the forum and looking up the Sheets API, and the Wix REST Api tutorial for sending an email, but I’m not sure how to put it together, get Wix to talk to Sheets and calling the Sheets functions. Any chance of getting some leads on this?
If anyone is interested I solved this with Sheetsu. Made a free account and used HTTPS requests in Wix to update rows in sheets.
You have my attention
Please share more on this Luke.
function loadResults(currentNumber)
{
// following PUT is for updating a cell
//PUT var url = “https://sheetsu.com/apis/v1.0su/{sheetsu API}/{column_name}/{value}?{column_name}={new_value)”;
var pastSearch = local.getItem("pastSearch");
var url = "https://sheetsu.com/apis/v1.0su/{SheetsuAPI}/{column_name}/
//building full URL for updating a cell as in example above
//currentNumber passed in from another function, this would be whatever you wanted to update cell with
var urlfull = url + pastSearch + “?Column=” + currentNumber;
local.setItem(“pastSearch”,currentNumber);
//saves the new cell value as you need the cell value to tell sheetsu what cell to look for
//calls sheetsu url with method put. I tried sending a JSON string with it as described in the sheetsu doc but couldnt get that to work so I built the URL string
fetch(urlfull, {method: ‘put’})
}
That example is for PUT and updating a single cell. GET or adding a row with POST should be even easier. I used the Postman API program on windows to test API calls. When you make a call in that program is shows you what the correct URL it used was. You can also use Hurl.it to test API calls.
{column_name} = first cell in column
{value} = sheetsu searches down the column with column_name for value
{sheetsu_api} will be given to you when you make a sheetsu.com account and share whatever spreadsheet your working with.
https://docs.sheetsu.com/?html--javascript#search-spreadsheet is the sheetsu doc to go over what calls you can use
Hey Luke,
I wonder how you are doing with Sheetsu? Is it working well and is the free account sufficient?
We would need a better solution ideally, but I wonder if you would recommend sheetsu in the meantime?
Last: have you tried their website tool? if so how does it compare to the Wix Dynamic Pages in terms of EO ranking?
Many question, I know…
Tony
Hey Tony, I was using a WebHook with Zapier to send data to Wix from a sheet, and return data with Sheetsu since I couldnt figure out Zapier in reverse. The point was to use sheets as the Database as it has better data manipulation, or at least more familiar to me, but in the end I gave up trying to use Sheetsu and Zapier as it wasn’t instant. Sheetsu was working perfectly for sending data back to a sheet though, and if I’m remembering correctly it was nearly instant, while the Zapier webhook wasn’t pulling its weight. I didnt use ranking or their webtool.
Sorry its been awhile since I stopped using it so I can’t give you a better answer. I’m just exporting a CSV and uploading it to a Wix database now and using wixcode for everything else.
Got you - but why using a CSV upload instead of sheetsu if it was working well?
I imagine that Sheetsu would not be able to do a Write on a collection like zapier?
Tony
The specific reason I was using this was so that the user entered text into a box on the Wix site, then when they clicked a button it sent that text into a box in a google sheet that then ran a query on the rest of the database in the google sheet. It was hosted in an iFrame to show the result. I ended up just using the CSV export so I could have my exact google sheet in the wix database, then used queries etc. in wix code instead
It is now possible using npm. Check out Yisrael’s cool example https://www.wix.com/code/home/forum/wix-tips-and-updates/example-google-sheets-npm