I'm trying to add custom function support for our spreadsheets. I've defined the function and I've been able to get it working as expected but sometimes I run into an issue with the sheets.rows.cells.formula field.
This documentation page claims it's supposed to be a string, and if I console log it like in the code block below it behaves as expected. But if I take that JSON and try to pass it to a different file or the database to then parse back into an object and perform various operations on the data the values change. Instead of the nice sheets.rows.cells.formula being the formula string that I set, it's now turned into a function reference despite no operations being done to the data aside from converting to and from JSON. Sometimes even if I don't convert to and from JSON and just pass the object it will mutate itself inexplicably.
Am I doing something wrong here? Why would the values change just by converting to and from JSON? I need that formula data and the function reference does not help me.