Hi all,
I have a SQL definition query i have created for a layer in arcgis pro. I can see and tested it works fine and is active as it has the green tick.
Now when i go publish it, the definition query does not work in ArcGIS online. Can anyone recommend reason and if i can just set it in arcgis online?
Solved! Go to Solution.
There's this page here, but even though it mentions Arcade, I believe that is only if you're working with the hosted layer from within Pro.
If you go to the Data tab on the content item in AGOL, you can open the field calculator there by clicking on a column heading.
Clicking Calculate will open the Calculate Field window, in which you can utilize various SQL functions.
How are you publishing the layer? You may need to configure the layer's Filter settings in the web map to recreate your definition query.
If you've published a hosted feature layer, you also have the option of creating a hosted feature layer view, which can have its own definition query applied to it.
Thanks for the response.
I am publishing it as a feature layer.
I have set this query up in the SQL definition in ArcGIS Pro - Item/1000 = Round ( Item/1000,0)
Now when I go to ArcGIS Online, I do see the filter option but it does not have ability to set to the query listed above.
Ah, I see. That sort of a query is more complex than the AGOL filter can do. I can think of a couple ways to do this, but is the underlying data going to be edited regularly?
You could add a field and use your SQL statement in the AGOL field calculator to return a true/false, then set the filter to look at that field. But you'd need to re-calculate the field whenever new data is added.
The good news is the underlying data will never need to be edited again. It is a layer which will be a one off task.
That is a good shout, is there any documentation on the AGOL field calculator.
There's this page here, but even though it mentions Arcade, I believe that is only if you're working with the hosted layer from within Pro.
If you go to the Data tab on the content item in AGOL, you can open the field calculator there by clicking on a column heading.
Clicking Calculate will open the Calculate Field window, in which you can utilize various SQL functions.