0

I'm using Google-Appscripts (JavaScript)

I've a line of code here

console.log("filldata()"+x); google.script.run.withSuccessHandler(getcolumndata).getcolumncontent(x);

getcolumncontent() is in my Code.gs file and getcolumndata() is in my js.html file.

I've a logger.log at the top of getcolumncontent() to see the content of X once it is passed. X in this case is an array with 3 parts, all strings (no dates).

function getcolumncontent(x){ Logger.log("x ",x); }

X is returned as a blank and I'm not sure why? if anyone has any suggestions please let me know.

I have an similar line of code 2 line above the issue line THAT WORKS NO PROBLEM - google.script.run.withSuccessHandler(setcolumndata).getcolumns(y); where y is an array with 2 parts both strings, no dates.

Any suggestions would be greatly appreciated.

2 Answers 2

1

If your problem is that you can't see the content of x in the console log from this piece of code:

function getcolumncontent(x){ Logger.log("x ",x); }

then I think it's because you haven't concatenated your string. You should have used a + instead of a ,:

function getcolumncontent(x){ Logger.log("x " + x); }
Sign up to request clarification or add additional context in comments.

Comments

1

Do you have a return value?

I'm not sure what is in getcolumncontent() but whatever is returned from that function, is what gets passed to the onSuccessHandler.

For example


function one(x){
        x += 1
        return x // this "new" x is passed to the onSuccessHandler
    }
    
function two(x){
        Logger.log(x)
    }
google.script.run.withSuccessHandler(two).one(1);

This will print 2 to the Apps Script console.

Referenece

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.