full-path / ridesheet

Google apps script support for a Google Sheets-based demand-responsive trip scheduling and reporting system.
MIT License
5 stars 4 forks source link

Checkboxes created with fixRowDataValidation() do not work (ridenoco-trip-request) #111

Open NomeQ opened 10 months ago

NomeQ commented 10 months ago

In api_provider.js, the receiveTripRequest() method now uses createRow() to append new trips to the Outside Trips sheet. The "Claim" and "Decline" columns are defined now in constants.js and when creating a new row, the validation rules there are used to format the columns as checkboxes.

It initially appears to work; however, clicking on a checkbox changes the cell content to "TRUE" and breaks the validation rule.

keviniano commented 10 months ago

I think this might be a clash between formatting and data validation. Check out this on Google's forum for Sheets: https://support.google.com/docs/thread/104768094?hl=en&msgid=104776121

keviniano commented 10 months ago

This could possibly be fixed in the "repair sheets" process by defining both formatting and data validation for the appropriate columns in defaultDocumentProperties in constants.

NomeQ commented 9 months ago

@keviniano tagging you to look at this. In my end, the offending code is running during createRow() in the fixRowDataValidation() function. This occurs in outside trips, when creating a new trip request.

keviniano commented 9 months ago

OK, after a bunch of testing of difference scenarios, here's what I've found:

In another RideSheet instance, I have cells formatted the "wrong way" (custom checked value = TRUE with formatting set to Automatic) without any issue. I don't know why your test environment is different, but at least we have three ways of getting things to work.

Reference: See this helpful Stack Overload conversation for more information about how to set number formatting using GAS.