🏠 back to Observable

Help with stateful interaction with notebook by multiple users

Hi, I would like to get some advice on how/if we could implement stateful interaction by multiple users in a notebook (https://observablehq.com/@ismms-himc/covid-19-sars-cov-2-preprints-from-medrxiv-and-biorxiv). We have a simple notebook that is pulling an up to date list of research papers, showing the newest by date, and showing them as a table. Would it be possible to allow users to come to this notebook and add a summary to each paper as they read it? I was thinking that I could have a function that a user runs to add a summary of a paper

function add_summary( doi, summary ) { for (var i in clean_data) { if (clean_data[i].rel_doi == doi) { clean_data[i].Summary = summary; break; //Stop this loop, we found it! } } }
adapted from https://stackoverflow.com/questions/4689856/how-to-change-value-of-object-which-is-inside-an-array-using-javascript-or-jquer/45341595

I’m not sure if this type of interaction would work or if there is a better approach to take.

Maybe the solution we’ll take is to have users download a CSV with summaries, update with a new summary, then upload the CSV to the notebook. So that way the CSV is the stateful piece of the notebook that multiple users can edit (e.g. make pull requests to).

Maybe you could do something with a notebook backed by google sheets? I wrote this notebook a while ago mainly for the read-only use case, but perhaps it can help you get started with shared google sheets:

1 Like

Thanks @bgchen the Google sheet approach works for our purposes. Although it can be a little slow to update from the Google sheet (a very small price to pay).

1 Like