Skip to content

fix: support formulas in gsheets_update_cell#21

Open
faionfaion wants to merge 1 commit intoisaacphi:mainfrom
faionfaion:fix-formula-support
Open

fix: support formulas in gsheets_update_cell#21
faionfaion wants to merge 1 commit intoisaacphi:mainfrom
faionfaion:fix-formula-support

Conversation

@faionfaion
Copy link
Copy Markdown

Summary

  • Use USER_ENTERED valueInputOption when value starts with = (formula)
  • Keep RAW for regular values to preserve existing behavior

Problem

Currently, entering a formula like =A1+B1 results in the literal text being stored with a leading apostrophe ('=A1+B1), preventing formula evaluation.

Solution

Check if value starts with = and use USER_ENTERED in that case, allowing Google Sheets to interpret it as a formula.

valueInputOption: value.startsWith("=") ? "USER_ENTERED" : "RAW",

Test plan

  • Tested inserting formula =B36-B35 - correctly evaluates
  • Tested inserting plain text - stored as-is without interpretation

When value starts with '=' treat it as a formula by using USER_ENTERED
valueInputOption instead of RAW. This allows formulas to be properly
evaluated instead of being stored as literal text.
dmitry-simple-it added a commit to dmitry-simple-it/mcp-gdrive that referenced this pull request Jan 19, 2026
…e_cell

Change valueInputOption from RAW to USER_ENTERED to fix:
- Boolean values (TRUE/FALSE) being stored as text with leading apostrophe
- Formulas not being evaluated
- Numbers and dates not being recognized

Fixes isaacphi#22
Also addresses the issue described in PR isaacphi#21

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant