|
POST
|
@LindaSlattery you will just need to update the section at the top of the script under # Variables: JakeSkinner_0-1631545982975.png username = ArcGIS Online Username password = ArcGIS Online Password itemID = item ID of the ArcGIS Online hosted table. This can be found in the URL when you view the item details JakeSkinner_1-1631546088368.png dataURL = the URL to retrieve data from the API you're querying After that, you should be able to execute the script.
... View more
09-13-2021
08:15 AM
|
0
|
0
|
4214
|
|
POST
|
Hi @FionaMcLaughlin , Have you tried the same workflow using a File Geodatabase feature class rather than a shapefile? I try to avoid shapefiles like the plague.
... View more
09-13-2021
06:13 AM
|
1
|
0
|
1505
|
|
POST
|
@LindaSlattery here is an example how to update a hosted table in AGOL using Python and the ArcGIS for Python API with the data example you provided. The hosted table's field names match the same as the Data object in you sample. You should just have to update the parameters: import requests, json
from arcgis import GIS
# Variables
username = "jskinner_CountySandbox" # AGOL Username
password = "********" # AGOL Password
itemID = 'f214df9b8f5440149a20ccd5d452a95e' # AGOL Table Item ID
dataURL = 'https://eagle-i.doe.gov/api/outagesummary/countymax24hoursummary?state=OH&county=Adams&eiApiKey=0000...'
# Disable warnings
requests.packages.urllib3.disable_warnings()
# Connect to AGOL
gis = GIS('https://www.arcgis.com', username, password)
# Get Table
fLayer = gis.content.get(itemID)
editTable = fLayer.tables[0]
# Get Data
params = {'f': 'pjson'}
r = requests.post(dataURL, data = params, verify=False)
response = json.loads(r.content)
data = response['data']
print(data)
# Create Dictionary of attributes
addFeatures = {
"attributes" : {
"currentOutage" : data[0]['currentOutage'],
"currentOutageRunStartTime" : data[0]['currentOutageRunStartTime'],
"maxOutage1" : data[0]['maxOutage1'],
"maxOutage1RunStartTime": data[0]['maxOutage1RunStartTime'],
"maxOutage24": data[0]['maxOutage24'],
"maxOutage24RunStartTime": data[0]['maxOutage24RunStartTime'],
"totalCustomers": data[0]['totalCustomers'],
"currentOutageHasOverrideData":data[0]['currentOutageHasOverrideData'],
"maxOutage24HasOverrideData": data[0]['maxOutage24HasOverrideData'],
"maxOutage1HasOverrideData": data[0]['maxOutage1HasOverrideData'],
"countyName": data[0]['countyName'],
"stateId": data[0]['stateId'],
"stateName": data[0]['stateName'],
"countyFIPSCode": data[0]['countyFIPSCode']
}
}
# Update Table
editTable.edit_features(adds=[addFeatures])
print("Finished")
... View more
09-10-2021
02:09 PM
|
1
|
1
|
4240
|
|
POST
|
@Kara_Shindle here is the URL that the Directions widget is referencing: https://utility.arcgis.com/usrsvcs/servers/aeef1739792143bb8eda2677a9791478/rest/services/World/Route/NAServer It doesn't appear that this is shared with Everyone. I would check this URL with the URL for the AGOL item (step 8 of the document).
... View more
09-10-2021
06:35 AM
|
0
|
1
|
2916
|
|
POST
|
It looks like your CSV is formatted to use a semi-colon (;) as the delimeter. Pandas defaults to using a comma (,). When reading the CSV, specify the delimeter parameter. Ex: csv_file = pd.read_csv('C:/Users/sphelele.ntilane/Desktop/Book.csv', delimiter=';')
... View more
09-10-2021
04:05 AM
|
0
|
0
|
2194
|
|
POST
|
@JackSelzer this will probably require troubleshooting: Try publishing the data as a new hosted feature service and see if the issue remains. Try publishing new data as a hosted a feature service and see if the issue remains.
... View more
09-09-2021
10:04 AM
|
0
|
1
|
2854
|
|
POST
|
@SpheleleNtilane7 can you provide a sample of the CSV your script is querying?
... View more
09-09-2021
09:56 AM
|
0
|
1
|
2209
|
|
POST
|
@Min-DongChang I was able to reproduce this, so I believe this is a bug. To workaround this issue, you could use os.path.isfile in place of arcpy.Exists. Ex: import arcpy, os
arcserver_ags_file = r"D:\_AGS_Connection\giswebsite@ArcServer@GIS_Admin.ags"
#### ArcServer Check ###
if os.path.isfile(arcserver_ags_file) == True:
print("The following arcserver_ags_file will be used: " + str(arcserver_ags_file))
if os.path.isfile(arcserver_ags_file) == False:
print("Stopping the script because your arcserver_ags_file is not set or does not exist.")
... View more
09-09-2021
09:20 AM
|
2
|
1
|
1985
|
|
POST
|
@TonyAlmeida I second @Anonymous User for compressing the geodatabase. You mentioned your feature class is versioned, so each time the delete features/append occurs you are adding records to the delta tables (A & D tables). If there are 10,000 features, you are adding 10,000 new rows to the A table, and 10,000 new rows to the D table. ArcGIS queries these tables to display/query the feature class. The larger these tables are, the longer it will take to query/display. In order to compress the geodatabase, you will want to make sure there are no locks on the feature classes. This means, you'll need to stop all ArcGIS Server services referencing data from your Enterprise Geodatabase. Here is a tool that may be helpful for you: https://community.esri.com/t5/data-management-documents/compress-geodatabase-tool/ta-p/908944
... View more
09-07-2021
11:39 AM
|
0
|
1
|
4721
|
|
POST
|
@ahargreaves_FW I would recommend following up with support. This may be a bug. You'll notice if you switch to AGOL as your active portal, you will have a Feature option under Vector Tile: JakeSkinner_0-1630342383054.png Once this option is checked, you have the ability to cache online: JakeSkinner_1-1630342429570.png
... View more
08-30-2021
09:53 AM
|
0
|
1
|
2667
|
|
POST
|
Yes, ArcGIS Velocity would work as well. It is very similar to GeoEvent and can also poll the API and send the JSON to a feature service.
... View more
08-18-2021
04:34 AM
|
0
|
0
|
2716
|
|
POST
|
@Anonymous User Yes, you will need to iterate through each service, check if it's dedicated, and then update the provider if it is using the ChangeProvider operation. Ex: import requests, json
# Variables
username = 'siteadmin'
password = 'siteadmin'
server = "ags.esri.com"
# Disable warnings
requests.packages.urllib3.disable_warnings()
# Function to change provider
def changeProvider():
print("\tChanging provider")
url = serviceURL + '/changeProvider'
params = {'f': 'pjson', 'token': token, 'provider': 'DMaps'}
r = requests.post(url, data=params, verify=False)
response = json.loads(r.content)
print(f"\t{response['status']}")
# Generate ArcGIS Server Token
tokenURL = f'https://{server}:6443/arcgis/admin/generateToken'
params = {'f': 'pjson', 'username': username, 'password': password, 'client': 'requestip'}
r = requests.post(tokenURL, data=params, verify=False)
response = json.loads(r.content)
token = response['token']
# Query AGS service propoerties in ROOT
baseUrl = f'https://{server}:6443/arcgis/admin/services'
params = {'f': 'pjson', 'token': token}
r = requests.post(baseUrl, data=params, verify=False)
catalog = json.loads(r.content)
services = catalog['services']
for service in services:
if service['type']!= 'StreamServer' and service['type'] != 'GPServer':
params = {'f': 'pjson', 'token': token}
serviceURL = f"{baseUrl}/{service['serviceName']}.{service['type']}"
r = requests.post(serviceURL, data=params, verify=False)
response = json.loads(r.content)
# Check if provider is dedicated
if response['provider'] == 'ArcObjects11':
# Execute function to change provider
print(f"{service['serviceName']} is dedicated")
changeProvider()
# Query AGS service propoerties in folders
folders = catalog['folders']
for folderName in folders:
if str(folderName) not in ('Hosted', 'System', 'Utilities', 'DataStoreCatalogs'):
baseUrl = f'https://{server}:6443/arcgis/admin/services/{folderName}'
params = {'f': 'pjson', 'token': token}
r = requests.post(baseUrl, data=params, verify=False)
catalog = json.loads(r.content)
services = catalog['services']
for service in services:
if service['type'] != 'StreamServer' and service['type'] != 'GPServer':
serviceURL = f"{baseUrl}/{service['serviceName']}.{service['type']}"
r = requests.post(serviceURL, data=params, verify=False)
response = json.loads(r.content)
if response['provider'] == 'ArcObjects11':
# Execute function to change provider
print(f"{service['serviceName']} is dedicated")
changeProvider()
... View more
08-18-2021
04:23 AM
|
0
|
0
|
1969
|
|
POST
|
Attached is the sample data I used. Can you test with this and see if you get the same error?
... View more
08-13-2021
03:09 PM
|
0
|
0
|
3122
|
|
POST
|
@jhakesI created a similar GP tool. The code is slightly different, but it should export all attachments from an attachments table. It's attached below.
... View more
08-13-2021
09:49 AM
|
0
|
2
|
3143
|
|
IDEA
|
@AaronHester you can try the following tool: https://community.esri.com/t5/arcgis-online-documents/show-attachments-in-web-map-popup/ta-p/918926 It will create a new field with a URL of the image stored in the attachment table. The URL will contain a token, but you could use a Field Calc to remove that portion.
... View more
08-12-2021
12:16 PM
|
0
|
0
|
3205
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-08-2026 12:27 PM | |
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM |
| Online Status |
Offline
|
| Date Last Visited |
Tuesday
|