Importrange

@BlakeACroft Hard to help when you refer to the message you are receiving as “something like that” !

I suggest you take a look at some Googles scripting tutorials and get the basics down before you dive into the deep end with some sample code that you get from a board like this.

This series is pretty good: https://www.youtube.com/playlist?list=PLv9Pf9aNgemv62NNC5bXLR0CzeaIj5bcw

1 Like

I got a “Illegal character. (line 11, file “Code”)” error

Put double quotes instead of simple quote to the getSheetByName function.

1 Like

@Christophe_HK @BlakeACroft It is not the single quote that is giving the error. I missed the Illegal characters around the “L2” and “L3” when I copy, pasted and fixed the original code. For some reason this forum software replaces all the single and double quotes with some other character that looks like single and double quotes but is not the same ascii values I guess. Javascript, which is what Google Script is based on allows either single for double quotes to designate a string.

1 Like

Thanks for this guys. I will investigate implementing on my apps that use importfeed.

I don’t understand why my PRO apps are not refreshing the today function. My app.native.zone before would show today’s moon when I visited from browser. Now I have to open the spreadsheet for it to be updated in the app. @david , did this feature get cut from PRO apps? Or should do I update my method?

Have you set the background refresh for your pro apps?

https://docs.glideapps.com/all/guides/quick-starts/getting-started/background-refresh#background-refresh-pro

They are working in solving ia bug in importrange refreshing

1 Like

IMPORTRANGE has always had this refresh behavior and we’ve always documented it: https://docs.glideapps.com/all/reference/using-sheets/importrange

We created background refresh as a Pro feature to work around this.

Thank you! Works perfect.

1 Like

Hi David

Did you get this done. I need some help as I created a script to look for onedit changes and it only works when I physically open the sheet and click on the cells. In particular my sheet uses checkboxs when events happen and then the script looks for these true / false columns and creates a date and time in the next field to the right. My issue is that it doesnt seem to work when changes are made in my app but it does work when I manually change the cells by clicking on the checkboxs…
Any ideas would be appreciated.
Thanks

Yes, background refresh has been available for awhile…but that’s not your problem. The only trigger that works with changes from Glide is the onChange event, the time trigger also works if you want to run the script every few minutes instead. OnEdit only works with changes made within the sheet itself.

Hi Jeff, I am developing an app which requires multiple checkboxs to be activated and when they change they need a date time stamp in the next 2 fields, the first time stamp for the initial change and the second timestamp on any further changes (last submitted times) I have 6 of these on a posts page and therefore can only use the time stamp for the submission of the post itself. The other 5 checkboxs need a unique time stamp when they are activated or changed for the first time. These checkboxs are being run from the edit screen within the glide app. l have used scripts calling the onEdit function however they only work when I edit the sheet and not when glide posts to the sheet. Can you help me find a solution that works?

@Johnny onEdit isn’t going to work. Like I mentioned, you need to use the onChange trigger instead. See if any of this helps.

1 Like

Thanks Jeff

1 Like

I want to share an experience with the Importrange

You will need to ensure not to add a row ID because its useless if you are going to use filter or query to filter out a certain data to limit the amount of data that you need to import and this to make sure to speed up the sheet data.

Don’t use Glide automated ROW ID because it will count the empty cells and rows

Is it true that I can’t use the IMPORTRANGE function to import data from an outside Google Sheet (not being used by Glide) to a Sheet that’s used for Glide data (the Glide app)? Just wanted to confirm. Or can I use IMPORTRANGE to import the data once, and then copy that data and paste values only?

I use ImportRange successfully to move data between two Google sheets. It seems to work fine, maybe because of the back and forth nature of it, but I also use Glide’s background refresh, so that also helps to keep the ImportRange updated. Based on your other post, keep in mind that you can have multiple apps pointing to the same sheet, as well as sharing a glide table between apps.

1 Like

Ahhhh, so instead of using IMPORTRANGE and not having the ability for background refresh (because I’m not a Pro user), I can just point another Glide app (or multiple apps) to the same sheet, and accomplish the same result I’m looking for with IMPORTRANGE?

I believe so. I’m not totally sure how fast the sync is, but it’s worth trying.

1 Like