Hello, It's a little unclear by your description exactly what you want to do, if you want the values from the function while running in the [login to view URL] app to populate a google sheet or you just want a version of that function in your app and the google sheet is just an example, anyway I assume both can be done, but if it's not tooo much trouble it will help if you can give a little more specific explanation regarding what you want.
Thanks!