Custom Functions, displays in strange order in GSheet GUI.

101 views
Skip to first unread message

Thomas P.

unread,
Dec 19, 2024, 5:27:23 AM12/19/24
to Google Apps Script Community
I've coded some "Custom Functions", and equipped them with appropriate JSDoc.

All good, except for the ordering: 
Screenshot, from the GSheet GUI, when doing auto-completion:
Screenshot 2024-12-18 03.13.15.png


What's presented in the GSheet GUI (above screenshot), is neither alphabetically ordered nor is it reflecting the order of implementation (as found in the GSheet embedded GAS-Project's .gs-file).

Does anyone have any idea about how to remedy such disorderly behaviour?

Keith Andersen

unread,
Dec 19, 2024, 10:31:10 AM12/19/24
to google-apps-sc...@googlegroups.com

Are they in alphabetical order in app script? That's the only thing I could think of.



My website: https://sites.google.com/view/klaweb/
Passions: God, Family, Scriptures, Learning, Data Management, Google Sheets + App Script and much more!

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-script-community/3e039252-82d9-4337-839f-ee77a08aa812n%40googlegroups.com.

George Ghanem

unread,
Dec 19, 2024, 12:56:31 PM12/19/24
to google-apps-sc...@googlegroups.com

Yes, the Googlr AppsScript editor is not the best one out there although it does most things well. You can try using other editors to get this functionality. There are tools to upload and test code in place.


Thomas P.

unread,
Dec 19, 2024, 7:51:01 PM12/19/24
to Google Apps Script Community
@ George Ghanem
>> Yes, the Googlr AppsScript editor is not the best one out there although it does most things well. You can try using other editors to get this functionality. There are tools to upload and test code in place.
I'm a bit confused as to whether I misunderstand you, or the reverse:
My concern relates to auto-completion in the GSheet-GUI, not the GAS-IDE. 
If I was to pick another editor, and then found a way to upload my "CustomFunctions.gs"-file back into the GSheet embedded GAS-Project, then: How would that provide a solution to the GUI-ordering? 

George Ghanem

unread,
Dec 19, 2024, 11:18:37 PM12/19/24
to google-apps-sc...@googlegroups.com
From what I understand that you are looking for is how your custom functions are being displayed in the list. That is not the Spreadsheet GUI that does it, it's the IDE. So using another development environment could help solve that.

Unless I am not understanding what your intentions are of why you want the actual spreadsheet UI to show the custome function.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

Thomas P.

unread,
Dec 20, 2024, 12:43:29 AM12/20/24
to Google Apps Script Community
George,
My intention is indeed to have my custom functions show up in the actual SpreadSheet GUI (as i provided by Google as as WebApp, know as "Google Sheets"), - and my custom functions already do!
My grief is purely with the order in which they show up (it is neither in alphabetical sequence nor by sequence of declaration & implementation in the .gs-file) .

OK, then: No matter what external code editor I were to pick, then (eventually) the .gs-file needs to end up in the Google Sheets embedded  GAS-Project. 
- Do we agree this far ?
Once the .gs-file (it's actually named "CustomFunctions.gs"), is in (put back into the GAS-Project, after having been edited by an external code editor), then: Everything is parsed, interpreted, compiled, and ruled within Google's realm. 
- So, if everything ends up being handled within the Google realm of things, then: How would an external editor communicate (meta) information about the source code (plain text in fille: "CustomFuntions.gs"), into Google's realm?

George Ghanem

unread,
Dec 20, 2024, 1:11:04 PM12/20/24
to google-apps-sc...@googlegroups.com

I see.  From what you are saying it is a Webapp that displays the custom function. I assume the code for the webapp is something you wrote? Or is it an Add-On?

Can you share the code for the Webapp?


Thomas P.

unread,
Dec 21, 2024, 4:41:52 AM12/21/24
to Google Apps Script Community
@ George Ghanem
>> I see.  From what you are saying it is a Webapp that displays the custom function. I assume the code for the webapp is something you wrote? Or is it an Add-On?
>> Can you share the code for the Webapp?
I have not made any WebApp or AddOn.

When I wrote "SpreadSheet GUI (as i provided by Google as as WebApp, know as "Google Sheets")", then ... Oh, my inner keyboard-monkey must have been present.
: It should have read "SpreadSheet GUI (as is provided by Google as WebApp, known as "Google Sheets")"
If you click https://docs.google.com/spreadsheets/create , then ... yeah, that SpreadSheet GUI, produced by Google's WebApp, known as "Google Sheets".

As for sharing any of my own code (i.e. my own "CustomFunctions"), then there's little point, because there's no errors or problems to be found (they've all been tested and works as expected).
But, OK, here's one function (found in my "CustomFuntions.gs"-file, in the GSheet embedded GAS-Project).
  /**
   * Gets the GDrive FileName of this GSheet-file,
   * @returns {string} The GDrive FileName of this GSheet-file,
   * @customfunction
  */
  function custFileName() {
    return SpreadsheetApp.getActiveSpreadsheet().getName();
  }

The above function is found as the second function in the "CustomFunctions"-file. Yet, that's not reflected in the GSheet GUI:
      Screenshot 2024-12-18 03.13.15.png

So: That custom functions seems to be listed in random order, is what's driving me boinkers.
- They're not alphabetically ordered, they're not in the same order as found in my CustomFunctions-file, and they're not even in the same order I wrote them into my CustomFunctions-file.

George Ghanem

unread,
Dec 21, 2024, 3:26:41 PM12/21/24
to google-apps-sc...@googlegroups.com
ok Got it. Yeah need to keep that Monkey clear of the keyboard. :-)

 For Google's UI, unfortunately, I do not know of any way to modify that or change how they prioritize what they list. You can open up a ticket, but I can tell you probability they would address this is low.

Alternatively, you can define your own function to get that list of custom functions and order it the way you want.

 Sorry can't be more helpful.

 George

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

Thomas P.

unread,
Dec 22, 2024, 12:07:47 AM12/22/24
to Google Apps Script Community
George,
FYI: I just discovered something in the same neighborhood: Issue Tracker:: "The level of JsDoc support is not documented (for Sheets custom functions)"
- Unfortunately, that was raised 11.May.2020, so it's possibly one of those issues which will take a decade before being closed (and then maybe with a "Won't fix" or "Obsolete" closure).

Thomas P.

unread,
Dec 22, 2024, 12:44:01 AM12/22/24
to Google Apps Script Community
Additional, Related Info: (which I only just now realised).

The GAS-Editor, lists the functions in same order as found in the file:
     Screenshot 2024-12-22 06.37.56.png
Which perhaps makes the GSheet GUI random ordering even more mysterious.

Reply all
Reply to author
Forward
0 new messages