Skip to content

Stop google converting strings to numbers (USER_ENTERED vs RAW) #40

Open
@zaddok

Description

@zaddok

This library uses a very sensible USER_ENTERED default option for updating cells. There may be times (such as in my current project) where the ability to change this is useful. Currently the default is hardcoded:

func (s *Service) syncCells(sheet *Sheet) (err error) {
	path := fmt.Sprintf("/spreadsheets/%s/values:batchUpdate", sheet.Spreadsheet.ID)
	params := map[string]interface{}{
		"valueInputOption": "USER_ENTERED",
		"data":             make([]map[string]interface{}, 0, len(sheet.modifiedCells)),
	}

It is causing some problems for me (i.e an occasional string being represented as a number, which causes formatting and other minor issues)

Can we do a patch to allow this to be altered, what are your thoughts on making it adjustable?

https://developers.google.com/sheets/api/reference/rest/v4/ValueInputOption

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions