UPDATE: I have become aware that there is a flaw with this as running a script that alters the spreadsheet needs permissions that I can’t seem to figure out. The below app works fine when I’m logged in to my Google account in a browser, but if not, it does not. I’ll update this when or if I figure out a way.
I realize this may be an advanced feature but…
I have written a few Google script web apps that act as an API that return JSON formatted data from a spreadsheet. In any event it occurred to me that a developer could write a simple web app that would execute a function of their choice and just return a results flag in JSON that the Glide app would display, similar to the check that appears with a Form is submitted. So instead of opening up the devices default browser the link would be launched internally, without shelling out to a browser and the resultant JSON would be parsed for the success or fail message. Or empty message for that matter which would not show any return message within the app.
I have frequently seen requests in the community here of people asking for a way to run a spreadsheet function from within Glide, or have seen posts where if that feature were available it would solve their issue/request.
Here is a demo app I wrote to show this: https://randomize.glideapp.io (it is copyable)
Here is a share link to the spreadsheet (because I believe the script will not come across when you clone the app): https://docs.google.com/spreadsheets/d/1xUbFZvQ4rOldlhj9w_B6ae9wI6QDey0NxphVy9F3y3o/edit?usp=sharing
It’s a very simple app just to demonstrate the ability to run a function by the “Open as Link” option of a button. All it does is run a function that updates a column that is used to sort the data. I did implement the sort on a separate sheet so you can see the native data and the sorted data, but it could also have been done with the Glide sort feature.
If the “Execute as Link” were implemented then you would not see the browser open at all, just the success message. There still is the data refresh delay inherent with Glide only polling the sheet for changes every few min.
Getting the web app working is another whole topic that is too long to post here.