Query widget results with a URL

1480
6
Jump to solution
05-31-2019 03:13 AM
AlbertoCañivano
New Contributor III

I'm working on modifying the Query widget.
I need to pass a url with a query:
http://<name>?query=<Layer_name>%<field_name>%<field_value>
The previous link I got from the Share Widget.
Once I have that complete link I would like to be able to pass it to the Query widget and return the value of the Results window of the widget itself.

This functionality would want it to open automatically when the user enters the hyperlink in the browser.
Any idea how to get started?

Thanks for your help

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Alberto,

   Configure the Query widget in WAB to be "open at start" then in the Query widgets _initSelf function add code to retrieve the URL parameter.

You could just use the eSearch widget that is already developed to handle URL searches.

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus

Alberto,

   Configure the Query widget in WAB to be "open at start" then in the Query widgets _initSelf function add code to retrieve the URL parameter.

You could just use the eSearch widget that is already developed to handle URL searches.

0 Kudos
AlbertoCañivano
New Contributor III

Thank you for your answer, Robert.

I explain exactly what I want to do and you tell me if it can be done or not.
My goal is to integrate an external application with my viewer.
I have already integrated it in reverse with a feature action in the Query widget but now I am asked to be the integration of the external application to the viewer.
This application is a database in which the user can select one record or several records. I want that with those records (called with an id) can access the viewer and open specifically the Query widget to get the layer with those results because large extensions of territory could lose the selection made.
To connect the two applications I was going to do it with a hyperlink that took all the records that the user wants to visualize in the viewer but from what I have read with that url can not be filtered by multiple values.
Thank you very much for the help

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Alberto,

   WAB apps have certain url parameters that are built in and query is one of them:

http://doc.arcgis.com/en/web-appbuilder/manage-apps/app-url-parameters.htm#ESRI_SECTION1_ED1AF7A40AB...

0 Kudos
AlbertoCañivano
New Contributor III

But I can't pass more than one value to the url, is that correct?

http://.../index.html?query=<layer name>%<field name>%<field value>

Is it possible to do it using an "OR" or something like that?

https://community.esri.com/thread/178936

Thanks again!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Correct multiple values are not supported.

0 Kudos
AlbertoCañivano
New Contributor III

Thank you, Robert.

I'll find a way to do it differently.

It occurs to me to pass the values I want to filter to the query widget and then look for the way that the user is the one who fills it in an external way without having to do it from the tool itself, and when the user opens the viewer the tool is open, as you told me in the previous answer, and the filtered layer appears. 

0 Kudos