I’ve been working on a program that requires the Google Sheets & Charts plug-in to go in and edit cell values on a spreadsheet and then take the outcomes of those cell changes (ie the spreadsheet is doing some calculations that would be too complicated for Bubble to do) and shows this data in a repeating group.
Specifically, this is about recipe searching, so you type in a list of ingredients into the bubble program, the Google Sheets API then inputs these ingredients into the google sheet, then the google sheets works out which recipes contain these ingredients and those recipes appear in a cell, and (hopefully) this information can be accessed from the bubble program.
I’m doing this by states: setting a ‘Get Files’ page state to ‘Google Sheets- Get Files (Drive)’ with path/hash current date/time UNIX and a ‘Search Row’ page state to 'Google Sheets- Get Sheet Values (Row)‘s values’.
This all works fine the first time upon loading the program. I can search for an ingredient and it comes up with the repeating group showing all the recipes that contain that ingredient. However, when I clear my original search (and I’m not refreshing the page here) and search again for a different ingredient, the recipes don’t update.
The weird thing is that I can look at the Google Sheet that my program is supposed to have inputted this new ingredient into and can see that the Google Sheet has updated to include this change- so that part of the program has worked.
It seems then that the bubble program is not retrieving data from the updated google sheet, but the one for the previous search. It seems to be able to update the sheet once, but not twice?
My workflow upon pushing the ‘search’ button looks something like…
Set a ‘Get Files’ page state to ‘Google Sheets - Get Files (Drive)’ with path/hash being current date/time UNIX
Google Sheets - Write to Cell (writes the ingredient you’re searching for into the appropriate cell in the google sheet)
Set the ‘Get Files’ page state to ‘Google Sheets - Get Files (Drive)’ with path/hash being new current date/time UNIX
Set a ‘Search Row’ page state to 'Google Sheets- Get Sheet Values (Row)‘s values’ with the same spreadsheet id.
My repeating group that shows the recipe then retrieves data via Type of Content: Get Sheet Values (Row) and Data Source: page’s ‘Search Row’ state - see workflow above. So that should update with the Search Row state.
I can see in the step-by-step debugger that the 'Google Sheets- Get Sheet Values (Row)‘s values’ hasn’t updated to the new ingredient. Even though I can see that the cell in the google sheet has changed upon loading the file in a separate page of the program.
My thinking is that it’s something to do with the ‘Get Files’ page state needing to somehow refresh or reset.
Any input would be welcome!
Also if anyone can recommend any learning materials for this particular Plug-In that would also be really helpful!