Can anyone help, please? Error on update formulas in cells with API
Hello!
I am using your SmartSheets JavaScript SDK:https://github.com/smartsheet-platform/smartsheet-javascript-sdkfor automate some process in sheets.
But when i try to set/update formula in cells, i always get an error ‘#UNPARSED’ inside of cell in browser view. If i try to double click on this cell and then skip selection, i get a fully works formula, what me need.
Screenshot after app depend formula with API:https://i.ibb.co/Y8BrJzL/image-preview.png
And then, after double click and skip selection:https://i.ibb.co/HgwCJQ7/image-preview-1.png(formula works)
Formula update example on Node.js:https://gist.github.com/TTATPuOT/e2f58b0bd2805d40180a436de7e9f397
评论
-
Shaine Greenwood Employee
UPDATE: For anyone else who happens upon this community thread, my post wasn't the cause of the issue. See the post marked as Best Answer to know how this was resolved!
Hello—
From looking at your code, it appears you're using accent marks instead of straight quotes. Try switching to straight quotes:
id: rowId,
cells: [
{
columnId: columnId,
formula: "=IF(Правок${row.rowNumber} < 2; [Обработано кадров]${row.rowNumber} * 10 + [Из них с вырезкой]${row.rowNumber} * 10; ([Обработано кадров]${row.rowNumber} * 10 + [Из них с вырезкой]${row.rowNumber} * 10) * (1,1 - 0,1 * Правок${row.rowNumber}))"
},
如果doesn't work, the next thing that you might troubleshoot is when and how your function is being called. Looks like you've made this function asynchronous, meaning anything after it will be executed immediately.
If this function updates your row with the formula and this happens before your columns are named, or before data that the formula is referencing enters other cells, you may receive this error. You may want to call this function later in your script or consider not making it asynchronous.
Otherwise—联系我们的支持团队to troubleshoot further.
-
detsad ✭
i wrote support team twice. without answer for two weeks
-
dAVE Inden Employee
It looks like you are using Smartsheet set in the Russian language. When you have your language set to one we are localized in you can write formulas using separators for that language. With Russian you can write formulas using a comma for the decimal separator and a semi-colon for separating the phrases of your formula. This localization to your language happens in your browser when you work in Smartsheet.
The API is not localized in other languages and expects formulas to be entered using the English language with commas to separate parts of the formula and the decimal point for numbers. For example, a formula you would write in a cell in the browser would look like this:
=IF(Num1 > 1,5; [Num2]1; 0)
To add this formula via the API you would need to have it look like this:
=IF(Num1 > 1.5, [Num2]1, 0)
This will add the formula so that it doesn't give the #UNPARSEABLE error and then when you view it in your browser it will have the structure based on your language settings. -
detsad ✭
Thank you very much. Now its ok.
Для русскоговорящих. Замените точки с запятой на просто запятые, а разделители в числах на точки, и все заработает.
Categories
=IFERROR(INDEX(DISTINCT(LOWER(<\/strong>COLLECT(.....................))<\/strong>), 1), \"//www.santa-greenland.com/community/discussion/42771/\")<\/p> I haven't tested it yet, but I feel like it should work.<\/p>"},{"commentID":386435,"body":" Right. There are already a number of posts here in the community detailing how to pull a distinct or unique list from another sheet via formula. It usually involves the formula above without the LOWER function. The number 1 would output the first distinct value. Changing that to a 2 will output the second distinct value, so on and so forth. I usually use a helper column with the numbers manually entered so I can apply it as a column formula.<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":320,"name":"API & Developers","url":"https:\/\/community.smartsheet.com\/categories\/api-developers","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":369,"urlcode":"bridge-by-smartsheet","name":"Bridge"}]},{"discussionID":107674,"type":"question","name":"API PUT and Body help for Cell link from a cell in sheet \"a\" to sheet \"b\"","excerpt":"I am having trouble linking a cell from sheet a to b. I am new to using API and possibly just getting the call wrong? or the body. Any help would be appreciated. PUT: https:\/\/api.smartsheet.com\/2.0\/sheets\/4098048888098692\/rows\/1370574824361860\/cells\/259016080 Body: { \"cells\": [ { \"linkinFromCell\": {…","snippet":"I am having trouble linking a cell from sheet a to b. I am new to using API and possibly just getting the call wrong? or the body. Any help would be appreciated. PUT:…","categoryID":320,"dateInserted":"2023-07-17T16:23:24+00:00","dateUpdated":"2023-07-18T10:24:44+00:00","dateLastComment":"2023-07-18T16:45:05+00:00","insertUserID":135530,"insertUser":{"userID":135530,"name":"Carlo Rodriguez","url":"https:\/\/community.smartsheet.com\/profile\/Carlo%20Rodriguez","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-07-21T15:50:31+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":91566,"lastUserID":135530,"lastUser":{"userID":135530,"name":"Carlo Rodriguez","url":"https:\/\/community.smartsheet.com\/profile\/Carlo%20Rodriguez","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-07-21T15:50:31+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":60,"score":null,"hot":3379310909,"url":"https:\/\/community.smartsheet.com\/discussion\/107674\/api-put-and-body-help-for-cell-link-from-a-cell-in-sheet-a-to-sheet-b","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/107674\/api-put-and-body-help-for-cell-link-from-a-cell-in-sheet-a-to-sheet-b","format":"Rich","tagIDs":[472,563],"lastPost":{"discussionID":107674,"commentID":385785,"name":"Re: API PUT and Body help for Cell link from a cell in sheet \"a\" to sheet \"b\"","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/385785#Comment_385785","dateInserted":"2023-07-18T16:45:05+00:00","insertUserID":135530,"insertUser":{"userID":135530,"name":"Carlo Rodriguez","url":"https:\/\/community.smartsheet.com\/profile\/Carlo%20Rodriguez","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-07-21T15:50:31+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"API & Developers","url":"https:\/\/community.smartsheet.com\/categories\/api-developers"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-07-18T16:45:08+00:00","dateAnswered":"2023-07-18T11:38:00+00:00","acceptedAnswers":[{"commentID":385713,"body":"
<\/p>