Voice pattern

Post your questions and help other users.

Moderator: Martin

Grossmann
Posts: 7
Joined: 04 Dec 2014 21:39

Re: Voice pattern

Post by Grossmann » 03 Feb 2015 09:59

Martin wrote:Hi,

How are you launching the search in your flow, using the Start Activity: ...WEB_SEARCH? In this case you could also switch to an action Open URL in Browser with a URL like https://www.google.ch/search?q={images_ ... }&tbm=isch. Note that the value needs to be properly encoded when it contains spaces etc. so the URL should look like this:
https://www.google.ch/search?q={encodeU ... }&tbm=isch

Regards,
Martin
I think i understand, thanks. But in my example, there are two groups, one for images, and second for data. So this way is ok only for images. What about this "data_to_search" ? I schold have two Activity ? One for images and one for data ? I think well ? But in this way i should have new condition for to check what i use (images_to_search or data_to_search) before activity will start ?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Voice pattern

Post by Martin » 03 Feb 2015 19:40

Yes, you could either use a condition to check whether you want to search for images or data and then execute the correct action or you could also compose the whole URL in a script with different parameters and use one single action to open the browser:
-action Script with script:

Code: Select all

if (images_to_search != null)
{
   url = "https://www.google.ch/search?q={encodeURLForm(images_to_search)}&tbm=isch";
}
else
{
   url = "https://www.google.ch/search?q={encodeURLForm(data_to_search)}";
}
-action Open URL in Browser: {url}

Post Reply