o-spreadsheet
o-spreadsheet copied to clipboard
Get The value from the Formula cell
Hey
I can get the cell Content using this code which returns me the formula cell
model.getters.getCell("Sheet1",1,12)
but I was hoping . If some how I could manage to get the value that is computed using dependent cell so I could fill it up in my db
UPDATE:
I see there is evaluated object in model.getters.getCell("Sheet1",1,12)
but it showing me this
{value: "Loading...", type: "text"}
any help is much appreciated
Hi,
The string you are refering to is displayed for formulas depending on asynchronous data, you have to let some time for the server to return the data and let at least one evaluation take place before trying to fetch its evaluated value. Correct me if I'm wrong but I suppose that you met this error while trying to extract values from a formula inside Odoo?
if so, you could rely on waitForDataLoaded(model)
https://github.com/odoo/odoo/blob/17.0/addons/spreadsheet/static/src/helpers/model.js#L29 an asynchronous function that will resolve once every datasource (pivot/list/odoo graph) have received the server data and their related formulas have been evaluated.
Best regards