Best databound text field process?

What would be the best approach to bi-synchronize Google Sheets data connected to editable text entry fields (read/write)?

Please view the development shiny app and click on a data table row to view form text fields.

The overall goal is to mimic this:

Adding a data table with editable form data entry fields.

Any suggestions greatly appreciated.

1 Like

Because it's directly linking to Google Sheets, it's going to be a custom implementation.

Communication points to cover:

  • User Edit
    • Shiny Table to R
    • R to Google Sheets
  • Sheets Edit
    • Google Sheets to R
    • R to Shiny Table

Shiny Table to R

DT can have editable tables. See Section 2.3
Demo of getting information to R from the Browser:

R to Google Sheets

See the googlesheets R package

Google Sheets to R

You could maintain a last_updated value. Have a method poll every k seconds to check if the table has been updated.


k <- 5
last_updated <- reactiveVal(as.Date("1970-01-01"))
  last_sheet_updated <- ... # look up google sheet last updated time
  if ( isolate(last_updated()) - last_sheet_updated < 0) {
    # set the last updated time
    # update the browser
    update_user_table_method() # must be created

  # Test again in k seconds
  invalidateLater(k * 1000)

R to Shiny Table

Look for DT::dataTableProxy. See section 2.3: .

** Code untested

Thank you. Shall try and reply.

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.