How to navigate, or go to a folder in Drive with a Workspace Add-on

59 views
Skip to first unread message

Paul Armstrong

unread,
Feb 23, 2022, 4:06:28 AM2/23/22
to Google Apps Script Community
I am pretty sure this is not possible, but it seems worthwhile asking.

I want to use a Google Workspace Drive Add-On to help the user navigate, or go to a folder in their Drive. A folder that is currently not on the screen, but I know they have access to.

The closest I have got to being able to do this is with button action and a callback

    return CardService.newUniversalActionResponseBuilder()
        .setOpenLink(CardService.newOpenLink()
          .setUrl("https://drive.google.com/drive/folders/_Unique Google Drive Id Here_"))
        .build();


I also have my manifest set up correctly
 
     "urlFetchWhitelist": [
        "https://drive.google.com/drive/"
      ],


And this works as documented—it opens a new browser tab and takes the user to the target/desired folder.

But, I do not want to open a new browser tab.
I want to either replace the current tab's URL. Or better still, have an API that tells Drive to go to the desired/target folder (on the screen) for the user.
But there appears to be no such API or other hacks that make this possible.

Thank you!



 


Clark Lind

unread,
Feb 23, 2022, 7:45:43 AM2/23/22
to Google Apps Script Community
You've probably made the best thing possible based on the limitations unfortunately. 

Paul Armstrong | SECTION6

unread,
Feb 23, 2022, 11:13:10 PM2/23/22
to google-apps-sc...@googlegroups.com
Thank you! 
I think so too. The other problem. is that there is an issue with OpenLink which makes it only sometimes work.
So I am just not going to bother  

SECTION6Paul Armstrong
Head of Customer Engagement, SECTION6
P: +64 21 225 4009
E: paul.ar...@section6.nz
website | linkedin | vcard

IMPORTANT: This message and any files transmitted along with it are confidential and intended solely for the addressee. The information may also be privileged or otherwise protected by work-product immunity or other legal rules. If you are not the named addressee, any use, reproduction or dissemination of the message is strictly prohibited. If you have received this message in error, please notify the sender immediately by email or phone and delete this message from your system.



--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/18tqnD3Qw70/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/fbcc0d37-de37-427b-8920-7b14ab506c00n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages