Select to view content in your preferred language

Allow Users to Create Custom SQL Queries in ArcGIS Online

875
3
09-30-2024 11:27 AM
DanielBettinger
New Contributor

So I want to make a query or filter widget in experience builder that has one query for multiple different attributes. For example in my data certain projects have multiple developers. IE: Developer (1) to Developer (5):

DanielBettinger_0-1727711225397.png

And in the different developers there may be matching developers, so "Developer X" lets say could be listed in Developer (1) as well as Developer (3), So want to do one search for all those different developer features I have. I was hoping I could maybe paste in a custom sql expression but looks like that is not possible.

Would be very nice if we could allow for custom sql queries so we can use the filter or query and do one query on multiple attributes.

found this Idea in community page form a few years ago that asks the same thing:

https://community.esri.com/t5/arcgis-online-ideas/allow-users-to-create-custom-sql-queries-to/idi-p/...

0 Kudos
3 Replies
JeffreyThompson2
MVP Frequent Contributor

End user defined filters are coming in the next update.

JeffreyThompson2_0-1727786186068.png

For now, it is possible for end users to build custom filters in a number of widgets including: List, Map Layers and Table.

If you are looking for an option to type out your own SQL queries, instead of using the SQL Builder, I don't anticipate that happening.

GIS Developer
City of Arlington, Texas
0 Kudos
DanielBettinger
New Contributor

Ok maybe the Custom Filter will do what I am wanting. Essentially, I'm looking for a single filter that can search across multiple fields and return matches wherever the data aligns. I have been messing with the different filtering widgets with a few different support agents and have not a figured out a combination of settings that that results in my desired affect. Will wait for the upcoming release and see if that accomplishes what I am trying to do.

0 Kudos
JeffreyThompson2
MVP Frequent Contributor

Re-reading your question, here are two possible solutions for the query you are trying to make.

  1. Create a clause set with the OR connector. Make a series of clauses like Developer 1 is Jim, Developer 2 is Jim, etc. This should find Jim in whatever field he is in.
  2. Add a new calculated field to your layer called combined_developers that combines the values of all of the developer fields into a single comma separated list. Then use a filter like combined_developers contains Jim, (include that comma in case you have a different developer called Jim Harper). 

I would go with the second option. 

GIS Developer
City of Arlington, Texas