Can't Repro
Status Update
Comments
in...@gmail.com <in...@gmail.com> #2
Cont...
the cell value of a custom function becomes #N/A after about 1 hour.
the cell value of a custom function becomes #N/A after about 1 hour.
as...@google.com <as...@google.com> #3
Hello,
I am unable to reproduce the problem you are describing.
When a cell shows N/A, there is usually a tooltip that pops up when you hover over that cell. Would you please check what it is saying?
Thanks,
Anton
I am unable to reproduce the problem you are describing.
When a cell shows N/A, there is usually a tooltip that pops up when you hover over that cell. Would you please check what it is saying?
Thanks,
Anton
in...@gmail.com <in...@gmail.com> #4
These steps tend to consistently produce the error. (links actual Spreadsheet/Service below)
1) set the script to run as a service.
2) close the spreadsheet
3) wait about 20mins
4) run the service to get the cell value. (dont open the spreadsheet)
Reproducing can be a bit hit and miss.
try the link below.
If it shows "customFunctionValues:Works OKWorks OKWorks .."
then wait 20mins and try again. ( I suspect a 5-10 min wait is long enough,
but not 100% sure)
If it shows "customFunctionValues:#N/A#N/A#N/A#N/A..."
then reload the page a few times
https://docs.google.com/macros/exec?service=AKfycbydzyHegJ69CN6zJNrs_GDXCVtpoIJz1hyZzNJu
The spreadsheet that contains the code described in the issue report.
See Cells A31:A50
https://docs.google.com/spreadsheet/ccc?key=0AkGlO9jJLGO8dDRCNTVTVmRkVUVNNU90Y3E0bkVhTlE
In general this often gives #N/A
instantAppRange.getValue()
But this always works:
cellValue = instantAppRange.getValue();
for(var counter=15;cellValue.toString() == "#N/A" && counter>0; counter--) {
cellValue = instantAppRange.getValue();
}
1) set the script to run as a service.
2) close the spreadsheet
3) wait about 20mins
4) run the service to get the cell value. (dont open the spreadsheet)
Reproducing can be a bit hit and miss.
try the link below.
If it shows "customFunctionValues:Works OKWorks OKWorks .."
then wait 20mins and try again. ( I suspect a 5-10 min wait is long enough,
but not 100% sure)
If it shows "customFunctionValues:#N/A#N/A#N/A#N/A..."
then reload the page a few times
The spreadsheet that contains the code described in the issue report.
See Cells A31:A50
In general this often gives #N/A
instantAppRange.getValue()
But this always works:
cellValue = instantAppRange.getValue();
for(var counter=15;cellValue.toString() == "#N/A" && counter>0; counter--) {
cellValue = instantAppRange.getValue();
}
in...@gmail.com <in...@gmail.com> #5
Cont ..
Regards the tool tip:
The "tool tip" never contains an error message.
Regards the tool tip:
The "tool tip" never contains an error message.
[Deleted User] <[Deleted User]> #6
Since, asora...@google.com has changed the status to FeedbackRequested, I hope that the following will help. The first two times I ran the method "naEmail," from the Script Editor, I got an email with this in the body. I can schedule this to run each hour and I get #N/A every time.
Formula =sleepText("hi") returned #N/A
/*
You can add this script into any new spread sheet and schedule it per the
directions below. This script will add its own tab.
Run a script at a time or times you designate:
From the Script Editor, choose Resources > Current script's triggers. You
see a panel with the message No triggers set up. Click here to add one now.
Click the link that says No triggers set up. Click here to add one now.
Under Run, select the function you want executed on schedule.
Under Events, select Time-driven.
On the first drop-down list that appears, select Hour timer
*/
function naEmail() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var s = ss.getSheetByName("CustomFunction Script Events");
if(s == null)
s = ss.insertSheet("CustomFunction Script Events", 1);
var aRange = s.getRange("A1");
aRange.setFormula("=sleepText(\"hi\")");
var aValue = aRange.getValue();
var userEmail = Session.getUser().getEmail();
MailApp.sendEmail(userEmail, "CustomFunction Script Events",
"Formula =sleepText(\"hi\") returned " + aValue);
}
function sleepText(text) {
Utilities.sleep(1000);
return text;
}
Formula =sleepText("hi") returned #N/A
/*
You can add this script into any new spread sheet and schedule it per the
directions below. This script will add its own tab.
Run a script at a time or times you designate:
From the Script Editor, choose Resources > Current script's triggers. You
see a panel with the message No triggers set up. Click here to add one now.
Click the link that says No triggers set up. Click here to add one now.
Under Run, select the function you want executed on schedule.
Under Events, select Time-driven.
On the first drop-down list that appears, select Hour timer
*/
function naEmail() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var s = ss.getSheetByName("CustomFunction Script Events");
if(s == null)
s = ss.insertSheet("CustomFunction Script Events", 1);
var aRange = s.getRange("A1");
aRange.setFormula("=sleepText(\"hi\")");
var aValue = aRange.getValue();
var userEmail = Session.getUser().getEmail();
MailApp.sendEmail(userEmail, "CustomFunction Script Events",
"Formula =sleepText(\"hi\") returned " + aValue);
}
function sleepText(text) {
Utilities.sleep(1000);
return text;
}
[Deleted User] <[Deleted User]> #7
It has been 4 days, I gave some code that will re-produce the issue. Do you still need Feedback? Please update the status...
gr...@gmail.com <gr...@gmail.com> #8
:/ I have the same problem... And this still without answer.
When i read from WebApp and DON'T access the spreadsheet for a minutes. Have this result:
Cells with function return me #N/A ( formulas from spreadsheet function, not from GAS like show InstantW...@gmail.com , but is the same base "functions" )
Cells with only text, i can read fine.
I can set values of cells too.
Only works when:
The WepApp start ( F5 for refresh ).. for a minutes. ( I think, this work because is a spreadsheet function and not a GAS function like show InstantW...@gmail.com )
And when i open the spreadsheet.
When i try it, i use a button with Server Handler for setText some Label.
There is a way for renew the cell values on a spreadsheet from GAS ?.
Sorry for my "english".
When i read from WebApp and DON'T access the spreadsheet for a minutes. Have this result:
Cells with function return me #N/A ( formulas from spreadsheet function, not from GAS like show InstantW...@gmail.com , but is the same base "functions" )
Cells with only text, i can read fine.
I can set values of cells too.
Only works when:
The WepApp start ( F5 for refresh ).. for a minutes. ( I think, this work because is a spreadsheet function and not a GAS function like show InstantW...@gmail.com )
And when i open the spreadsheet.
When i try it, i use a button with Server Handler for setText some Label.
There is a way for renew the cell values on a spreadsheet from GAS ?.
Sorry for my "english".
in...@gmail.com <in...@gmail.com> #9
From the web app, you can get the value of the Cell and check if the value is #N/A. If the Cell value is #N/A you can wait 100ms and retry. This solution works most of the time, but is not perfect. Even with several retries you can still get an error.
This issues has only been stared by 3 people, so I am not holding out much hope it will get fixed.
This issues has only been stared by 3 people, so I am not holding out much hope it will get fixed.
ko...@gmail.com <ko...@gmail.com>
ko...@gmail.com <ko...@gmail.com> #10
Thank you for reporting this issue. We've been able to replicate the problem and have raised it internally.
[Deleted User] <[Deleted User]> #11
Checking in on the status of this item. I am building a dynamic site that (using Zend) generates content from a Google Spreadsheet - specifically links that are generated using custom functions. If the target Google spreadsheet is open, the links are all correct. If the target Google spreadsheet is NOT open, all of the links on the site return #N/A requiring me to refresh/reload the web page multiple times until the custom functions have finished processing.
Is there a response I could check for (from the Google Spreadsheet) that would tell my Web app that all of the custom functions have been processed - before I load the page?
Is there a response I could check for (from the Google Spreadsheet) that would tell my Web app that all of the custom functions have been processed - before I load the page?
sc...@gmail.com <sc...@gmail.com> #12
[Comment deleted]
mi...@yellow-online.nl <mi...@yellow-online.nl> #14
This is also on issue for me. I have custom functions (sending values to AdWords script) in a couple of cells which update correctly as long as the sheet is open, but return #N/A when the spreadsheet is closed.
ko...@gmail.com <ko...@gmail.com> #17
We can no longer reproduce this issue. Closing for now.
Description
1. Create a custom function
function textBox(textBoxValue) {
return textBoxValue;
}
2. put this in a cell =textBox("eddyparkinson at mailaddress")
3. Wait (about 1 day is long enough) for the cell value to
become #N/A (not sure what causes the value to become #N/A, a cache time out?)
4. Use
Range.getValues(); to get the value from the cell.
Example code
function doGet() {
var spreadsheetKey = "hhhh";
var webPageSheet = SpreadsheetApp.openById(spreadsheetKey).getSheetByName("WebPage");
var instantAppRange = webPageSheet.getRange("A31:A50");
var rangeGuiData = instantAppRange.getValues();
var customFunctionValues = "";
for(var rowIndex in rangeGuiData) {
customFunctionValues = customFunctionValues + rangeGuiData[rowIndex][0];
}
var app = UiApp.createApplication();
var panel = app.createVerticalPanel();
panel.add(app.createLabel("customFunctionValues:"+customFunctionValues));
app.add(panel);
return app;
}
What is the expected output? What do you see instead?
Expected: The value of the cell
Instead: #N/A
On which browser & OS?
Windows 7, chrome/firefox (All I think)
Please provide any additional information below.
The #N/A is the value before the custom function executes.
When to re-execute the custom function looks to be an issue.
It looks like there is a need for two types of custom function.
One that uses ONLY parameter data and so only recalculates when
a parameter value changes.
One the uses "global" data, and need some other kind of refresh
trigger (onOpen/timer/onedit). It would be handy if the programmer could specify the refresh trigger.
The problem tends to happen if:
1) I open this link when the spreadsheet has not been used for a day or so.
The link creates a Web App using only spreadsheet functions.
But all the time I get #N/A. Making it unusable in the current state.
OR
2) if a change has just been made to the sheet and it is recalculating.
the Ugly workaround is to reload if "#N/A" is returned, but this
is slow, with several client server calls.
e.g.
for(var counter=15;rangeGuiData.values[row][col].toString() == "#N/A" && counter>0; counter--) {
rangeGuiData.values = instantAppRange.getValues();
}