Select to view content in your preferred language

maxRecordCount

6782
14
Jump to solution
02-07-2023 11:58 AM
Paco
by
Frequent Contributor

Another question about maxRecordCount.  

My AGOL Hosted point Feature Layer only allows up to 1000 selected features in my Webapp.

Like many others before me,  I have tried updating the Service Definition maxRecordCount to a higher number(10,000) and save,  but the selection still stays at 1000.  and it also reverts back to 1000 in the Service Defintion.   there are a few places to update that maxRecordCount in the definition, and only one of those reverts back to the lower number.

ESRI can we please get an explanation on Selecting AGOL Hosted Features?  please advise how to raise that maximum selection.

thx!

0 Kudos
1 Solution

Accepted Solutions
HollyTorpey_LSA
Frequent Contributor

Are you certain that you selected the desired layer within the feature service and updated its maxrecordcount value? I believe you need to do this even if your feature service has only one layer. And then I think you may also want to update the maxrecordcount for the parent service so that it's at least as much as the maxrecordcount of the layer it contains.

- Holly

View solution in original post

14 Replies
KenBuja
MVP Esteemed Contributor

When you updated it, did you also set the lastEditDate value to null in step 7 of the instructions?

0 Kudos
Paco
by
Frequent Contributor

Yep.  would i need to update All of the "_lastEditDate"s?

"lastEditDate" : null,
"schemaLastEditDate" : 1675798413474,
"dataLastEditDate" : 1675798413474

 

still,  everytime I go back to check the Definition,  the null is gone and the max count is back to 1000

 

0 Kudos
KenBuja
MVP Esteemed Contributor

When I needed to change it, I only modified the lastEditDate.

0 Kudos
HollyTorpey_LSA
Frequent Contributor

Are you certain that you selected the desired layer within the feature service and updated its maxrecordcount value? I believe you need to do this even if your feature service has only one layer. And then I think you may also want to update the maxrecordcount for the parent service so that it's at least as much as the maxrecordcount of the layer it contains.

- Holly
Paco
by
Frequent Contributor

Yes.  I am opening the specific Hosted Feature Layer in AGOL(using 'View' URL on the Overview page.   which gets me to the ArcGIS REST Services Directory,   and clicking on "Admin" in the upper right, and clicking on "Update Definition" at the bottom.

searching for and updating "maxRecordCount" and "lastEditDate"(10,000 and null) and clicking on "Update Service Defintion".  

going back to my Experience Builder application,  the selection box still only allows 1000 features.  and if I go back to the Service Defintion,  those updates have reverted back to 1000 and random numbers again.

has anyone gotten this to work with their AGOL Hosted Feature Layers?  does it only work in Portal?  any ideas?  

thanks again!

0 Kudos
Clubdebambos
Frequent Contributor

Hi @Paco 

I use the Python API to set the maxRecordCount for individual layers in a Feature Service as shown below.

from arcgis import GIS
from arcgis.features import FeatureLayer

agol = GIS("home")

update_dict = {
    "maxRecordCount": "10000"
}

item = agol.content.get("FS_ITEM_ID")

for lyr in item.layers:
    print(lyr.properties.name)
    fl = FeatureLayer(lyr.url, agol)
    print(fl.manager.update_definition(update_dict))

 

You can then check that this sticks by printing out the maxRecordCount property for each layer.

from arcgis import GIS
from arcgis.features import FeatureLayer

agol = GIS("home")

item = agol.content.get("FS_ITEM_ID")

for lyr in item.layers:
    print(lyr.properties.name)
    fl = FeatureLayer(lyr.url, agol)
    print(lyr.properties.maxRecordCount)

 

~ learn.finaldraftmapping.com
jschuckert
Occasional Contributor

@Clubdebambos , do you know if you can set the parameter to something other than the default at the time of publishing with the Python API? Or can you only update the parameter after publishing with the code you have outlined?

0 Kudos
ErinHourihan
New Contributor

Thank you for sharing this solution! Worked perfectly!

0 Kudos
SMH-Rio
Frequent Contributor

Using the script for ArcGIS Enterprise, despite being successful at all stages, the definition is not actually updated.

And when I try to use the same update_dict syntax directly in Enterprise, it also indicates success but does not update the json.

But thanks for sharing the code.

0 Kudos