Select to view content in your preferred language

Attempting to publish definition query and it dissapears

2888
5
Jump to solution
11-25-2020 02:54 AM
cardiokan
Occasional Contributor

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?

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

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.

jCarlson_0-1606316619885.png

Clicking Calculate will open the Calculate Field window, in which you can utilize various SQL functions.

jCarlson_1-1606316694966.png

 

- Josh Carlson
Kendall County GIS

View solution in original post

5 Replies
jcarlson
MVP Esteemed Contributor

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.

- Josh Carlson
Kendall County GIS
cardiokan
Occasional Contributor

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. 

0 Kudos
jcarlson
MVP Esteemed Contributor

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.

- Josh Carlson
Kendall County GIS
0 Kudos
cardiokan
Occasional Contributor

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. 

0 Kudos
jcarlson
MVP Esteemed Contributor

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.

jCarlson_0-1606316619885.png

Clicking Calculate will open the Calculate Field window, in which you can utilize various SQL functions.

jCarlson_1-1606316694966.png

 

- Josh Carlson
Kendall County GIS