Hi everyone,
Hope you all had a chance to try out our last tip. This month we have another interesting one for you—how to perform a quick Google search from Zoho Creator.
This tip can be useful for redirecting your users to Google to find relevant information based on the data entered in a form, report, or page.
Let's take the example of a library management application. With the availability of different subjects and genres of books, sometimes your users would like to do a quick search on the book or the author before purchasing or borrowing the book from the library. In such a case, you can easily redirect your users to Google once they enter the author's name or book's title.
For this tip, we'll use an OpenURL task with Google's request URL to perform a Google search.
The OpenURL Deluge task can be invoked from the Form and Field actions to redirect the form to a specified URL. You have the option to open the URL in the same window, a new window, a parent window, a pop up window, or an iframe.
Syntax
- To open the URL in the same window:
- openUrl("<url>", "same window")
- To open the URL in a new window
- openUrl("<url>", "new window")
- To open the URL in a parent window
- openUrl("<url>", "parent window")
- To open the URL in a popup window
- openUrl("<url>", "popup window", "height=<height>,width=<width>");
- To open the URL within named iframe elements on the same webpage
- openUrl("<url>","iframe","<frameName>");
Now here are the steps to perform this action on Zoho Creator:
Step 1: Create a Find Your Book form with the required fields.
The form Find Your Book should contain:
Title (Single line)
Author (Single line)
Edition (Single line)
Language (Single line)
Image (Image)
Step 2: Create a custom action button in the All resource report
We will create a Custom action button which will help us redirect the user to a Google search with the author's name prefilled from the form when the button is clicked using an OpenURL task.
Note: Add a condition here to execute the workflow only when the author name is not null.
Click on Edit workflow-> Deluge script-> Create your own script.
Step 3: Use an OpenURL task to pass the entered value in the Author field.
Drag and drop the OpenURL Deluge task to the editor area and pass the value entered in the Author field, and specify the URL to redirect the form and window type.
- openUrl("https://www.google.com/search?source=hp&ei=uMwtX-2iEN2G4-EPvNaJ-As&q=" +input.Author_Name+"&oq=new&gs_lcp=CgZwc3ktYWIQAzIICAAQsQMQgwEyCAgAELEDEIMBMggIABCxAxCDATICCAAyCAgAELEDEIMBMgUILhCxAzIFCC4QsQMyBQgAELEDMgIIADIICAAQsQMQgwE6DggAEOoCELQCEJoBEOUCOg4ILhCxAxCDARDHARCjAjoCCC5QlhpYix1gjh9oAXAAeACAAU2IAd4BkgEBM5gBAKABAaoBB2d3cy13aXqwAQY&sclient=psy-ab&ved=0ahUKEwjt3prIiYrrAhVdwzgGHTxrAr8Q4dUDCAc&uact=5","new window");
The example below is the All Resources report, where users can quickly view the books available and perform a quick search about the respective author. Whenever a user clicks the Google the author button, they'll immediately be redirected to Google, with the author's name as the Google search.
We hope this tip will help you solve any problems you might be having with your app. Give it a try and let us know what you think! If you hit any roadblocks, feel free to reach out to us and we 'll be happy to assist you.