Sherlock
Sherlock

Reputation: 5627

Direct to another URL using a server side handler

I am looking for a way to navigate to a URL using a button in my Google Apps Script UiApp. I have added an on click server handler to the button, and once the event is triggered I would like to navigate to a different URL.

Is there a way I can do this in a server side handler ?

Many thanks

Upvotes: 1

Views: 292

Answers (1)

Weehooey
Weehooey

Reputation: 1008

Relax_Im_A_Quant there is no way to have a server handler send the user to another URL. They have to click on a link.

However, there is a way to achieve similar results and may suit your needs.

You can add, remove and change the visibility of the elements in your UiApp.

For example, have a search box that starts visible and a results panel that starts not visible. When the server handler is called the search box is changed to not visible, the results panel changed to visible and the results are added to the results panel. You can turn off the visibility of a whole panel and turn on the visibility of a another.

In one of my apps that creates a document for the user, it would add a link to the document to the UiApp and then make it visible when the 'create document' button was pressed. It would prompt the user to click the link after it appeared -- taking them to the document (a new URL).

Upvotes: 2

Related Questions