|
POST
|
I'm using Pro v. 2.8 and I don't see anything related to the Number Format menu in the exported *.lyrx file? I am trying to do the same thing as you, which is to have a faster way to set the decimal place to 0 and check the Show thousands separators box.
... View more
08-18-2021
01:08 PM
|
1
|
2
|
7214
|
|
POST
|
I was wondering if there was a way to preset the Number Format Menu to desired settings instead of doing it manually every time a field is created. For example, here is how the default menu looks: How can I preset it like so (i.e. with decimal places 0 and show thousands separators checked)?
... View more
08-17-2021
02:29 PM
|
0
|
3
|
2657
|
|
POST
|
I'm trying to overwrite a hosted feature layer using a FGDB Feature Class. I've tried a couple things. First, I've tried merging the two. 1 import arcgis
from arcgis.gis import GIS
gis = GIS('Home')
fl = gis.content.get('item id goes here')
layer_to_merge = r'C:\Users\jpilbeam\Default.gdb\firstdose_test'
arcgis.features.analysis.merge_layers(fl, layer_to_merge) Result: Exception: Job failed. 2 Using this post as an example, I tried overwriting the hosted feature layer. import os, sys, arcpy
from arcgis.gis import GIS
source = GIS('Home', verify_cert=False)
layer = source.content.get('itemID goes here')
layer.update({}, r'C:\Users\jpilbeam\Default.gdb\firstdose_test')
layer.publish(overwrite=True, file_type='fileGeodatabase') Result: Exception: Invalid JSON in 'text' parameter.
(Error Code: 400)
... View more
08-12-2021
01:30 PM
|
0
|
1
|
1428
|
|
POST
|
I published a Feature Class from Pro into a folder in AGOL. I shared with a group. In AGOL I tried creating a view, but I get this same error message.
... View more
07-29-2021
01:14 PM
|
0
|
2
|
12149
|
|
POST
|
@RussRobertsNow we're back to it not working in FF.
... View more
07-29-2021
11:44 AM
|
0
|
0
|
3161
|
|
POST
|
How can I remove the name of the Feature Layer 'Doses' from the legend? I'm using the new Map Viewer. I know you go the the pop-up menu to change the field name 'SHOT_DOSE'. As a bonus I'd like to even remove the word 'Legend' from the legend. It's kind of obvious.
... View more
07-23-2021
09:13 AM
|
1
|
2
|
5655
|
|
POST
|
It must be something with Firefox? I switched to Chrome and now I can create 4.x apps!
... View more
07-22-2021
01:45 PM
|
1
|
2
|
3239
|
|
POST
|
There's something wrong. I can't configure any new app. They don't finish getting created. But, it still ends up in my Content. If I select Configure it's a blank page. If I select View Application I get of view of Seattle for some reason (I'm in Illinois).
... View more
07-22-2021
01:27 PM
|
0
|
0
|
3243
|
|
POST
|
@RussRobertsThanks for the idea. I tried creating a Media Map app, but for some reason it won't finish. I'll move on to the New Map Viewer and see if that helps. **Update I created the same map with the New Map Viewer and tried creating a Media Map through there. Same thing, it doesn't fully finish creating the app?
... View more
07-22-2021
12:51 PM
|
0
|
1
|
3250
|
|
POST
|
The whole dataset blinks when the time interval changes. How can I fix this? I have a point dataset that I've set up for time animation. I have the time interval set at two weeks (range of time is 8 months). And the symbol in the map is set on Unique Values for a field with more or less two different values (either 1 vaccine dose or two). In Pro I have the following settings for the Time. The END_DATE field has null values. I did this to keep the points from visually resetting after each 2 week interval. The animation works fine in Pro. However, it blinks in AGOL. I have time animation setting set as such:
... View more
07-22-2021
09:57 AM
|
0
|
7
|
3271
|
|
POST
|
@LongDinhThanks for the help. This was recently resolved. After a lot of trouble shooting, I still don't know that we (an ESRI analyst and I) nailed down a cause of that JSONDecode error because we tried so many things. But, this at least may be informative: When running a Python script that is set up to add then publish an item to Portal for ArcGIS the POST request to the /addItem endpoint of the Portal is being redirected, which causes the script to crash. What we ultimately came up with is a two part script that publishes a CSV to Portal, import json,requests
from arcgis.gis import GIS
import os,sys
import csv
from datetime import datetime
#the directory you want the csv written to
file_path = r'C:\Users\jpilbeam\Test'
#file name
csv_file = 'c19_Vaccine_Current_standAloneScriptTest'
##idph url goes here
idph_data = 'https://idph.illinois.gov/DPHPublicInformation/api/covidVaccine/getVaccineAdministrationCurrent'
#1----------------this section writes the json to a csv--------------
full_file = os.path.join(file_path, csv_file) + '.csv'
#get json data from idph
response = requests.get(idph_data)
#read the json response and keep the VaccineAdministration part
data = response.json()['VaccineAdministration']
#write to file
with open(full_file, 'w', newline='', encoding='UTF-8') as csvfile:
f = csv.writer(csvfile)
#write the headers of the csv file
f.writerow(['County','AdminCount','AdminCountChange', 'RollAvg', 'AllocDoses', 'FullyVaccinated', 'FullyVaccinatedChange', 'ReportDate', 'Pop', 'PctVaccinated', 'LHDInventory', 'CommInventory','TotalInventory', 'InventoryDate', 'Latitude', 'Longitude'])
for elem in data:
#get the values for all the keys (i.e. CountyName, AdministeredCount, etc...)
f.writerow([elem['CountyName'], elem['AdministeredCount'], elem['AdministeredCountChange'], elem['AdministeredCountRollAvg'], elem['AllocatedDoses'], elem['PersonsFullyVaccinated'], elem['PersonsFullyVaccinatedChange'], elem['Report_Date'], elem['Population'], elem['PctVaccinatedPopulation'], elem['LHDReportedInventory'], elem['CommunityReportedInventory'], elem['TotalReportedInventory'], elem['InventoryReportDate'], elem['Latitude'], elem['Longitude']])
print('csv successfully written')
#2------------this section takes that csv and publishes it to Enterprise Portal--------------
#provide Enterprise Portal login info here
gis_dest = GIS("home")
#content manager
cm = gis_dest.content
#add the CSV file
status = 1
while status <= 1:
try:
item = cm.add(item_properties={
'type' : 'CSV',
'title' : 'CoVID19_csvtest',
'tags' : 'test',
'typeKeywords' : "CSV"
},
data=full_file)
status = 2
print("Item added successfully.")
except:
print("Item failed to add, trying again...")
status = 0
#analyse/publish the CSV file
status = 1
while status <= 1:
try:
#analyze the CSV file to autogenerate the publish parameters
analyze_csv = cm.analyze(item=item, file_type='csv')
pp = analyze_csv['publishParameters']
#Publish
pitem = item.publish(publish_parameters=pp)
print(pitem.layers)
print("---done---")
status = 2
except:
print("Item publishing failed, trying again...")
status = 0 and because this is run on a regular basis the feature layer needs to be overwritten import json,requests
from arcgis.gis import GIS
from arcgis.features import FeatureLayerCollection
import os,sys
import csv
from datetime import datetime
#the directory you want the csv written to
file_path = r'C:\Users\jpilbeam\Test'
#file name
csv_file = 'c19_Vaccine_Current_standAloneScriptTest'
##idph url goes here
idph_data = 'https://idph.illinois.gov/DPHPublicInformation/api/covidVaccine/getVaccineAdministrationCurrent'
#1----------------this section writes the json to a csv--------------
full_file = os.path.join(file_path, csv_file)+ '.csv'
if os.path.exists(full_file):
os.remove(full_file)
#get json data from idph
response = requests.get(idph_data)
#read the json response and keep the VaccineAdministration part
data = response.json()['VaccineAdministration']
#write to file
with open(full_file, 'w', newline='', encoding='UTF-8') as csvfile:
f = csv.writer(csvfile)
#write the headers of the csv file
f.writerow(['County','AdminCount','AdminCountChange', 'RollAvg', 'AllocDoses', 'FullyVaccinated', 'FullyVaccinatedChange', 'ReportDate', 'Pop', 'PctVaccinated', 'LHDInventory', 'CommInventory','TotalInventory', 'InventoryDate', 'Latitude', 'Longitude'])
for elem in data:
#get the values for all the keys (i.e. CountyName, AdministeredCount, etc...)
f.writerow([elem['CountyName'], elem['AdministeredCount'], elem['AdministeredCountChange'], elem['AdministeredCountRollAvg'], elem['AllocatedDoses'], elem['PersonsFullyVaccinated'], elem['PersonsFullyVaccinatedChange'], elem['Report_Date'], elem['Population'], elem['PctVaccinatedPopulation'], elem['LHDReportedInventory'], elem['CommunityReportedInventory'], elem['TotalReportedInventory'], elem['InventoryReportDate'], elem['Latitude'], elem['Longitude']])
print('csv successfully written')
#2------------this section takes that csv and publishes it to Enterprise Portal--------------
#provide Enterprise Portal login info here
gis_dest = GIS("home")
#Get published item's ID to overwrite
hostedFeatureService = gis_dest.content.get('5c770f0e208d4504872a7e4b2a825124')
hostedFeatureLayerCollection = FeatureLayerCollection.fromitem(hostedFeatureService)
#overwrite existing HFL contents
status = 1
while status <= 1:
try:
result = hostedFeatureLayerCollection.manager.overwrite(full_file)
print('layer overwritten')
print('---done---')
status = 2
except:
print("Layer failed to overwrite, trying again...")
status = 0
... View more
07-14-2021
07:21 AM
|
1
|
0
|
6432
|
|
POST
|
It was eventually resolved. After getting some additional help I was able to publish the CSV. I sorta lost track of all the issues I was having, but part of it turned out to be a bug: #BUG -000136260. As much as I know, I don't think I had an issue with what you're suggesting. It had more to do with the POST request to the /additem endpoint of the Portal being redirected, which causes a JSON DecodeError. See these posts (which I'll update with the resolution tomorrow): https://community.esri.com/t5/python-questions/publish-a-csv-to-enterprise-portal-decoding-json-has-failed/m-p/1045803#M60736 https://github.com/Esri/arcgis-python-api/issues/947 I just tried publishing a xlsx file to Portal with the following script, but it also resulted in an error. from arcgis.gis import GIS
gis = GIS('Home')
#content manager
cm = gis.content
gdb = r'path\to\Test\Test_04_21_2021.xlsx'
#create item
item = cm.add(item_properties={
'type' : 'Microsoft Excel',
'typeKeywords' : 'Microsoft Excel'
},
data=gdb)
#create publish_parameters dictionary
pp={"type":"Microsoft Excel"}
pitem = item.publish(publish_parameters=pp)
print(pitem.tables)
print("---done---") Error: ---------------------------------------------------------------------------
Exception Traceback (most recent call last)
In [32]:
Line 5: pitem = item.publish(publish_parameters=pp)
File C:\pathto\Local\ESRI\conda\envs\my-env\Lib\site-packages\arcgis\gis\__init__.py, in publish:
Line 10332: res = self._portal.con.post(path, postdata)
File C:\pathtoa\Local\ESRI\conda\envs\my-env\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in post:
Line 720: force_bytes=kwargs.pop('force_bytes', False))
File C:\pathto\Local\ESRI\conda\envs\my-env\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in _handle_response:
Line 514: self._handle_json_error(data['error'], errorcode)
File C:\pathto\Local\ESRI\conda\envs\my-env\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in _handle_json_error:
Line 536: raise Exception(errormessage)
Exception: Analyze Service error: Server tool execution failed : ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds. No csv or txt found in item. Failed to execute (Analyze Features for Portal). Failed. Failed to execute (Analyze Features for Portal). Failed.
(Error Code: 0)
---------------------------------------------------------------------------
... View more
07-13-2021
02:40 PM
|
0
|
0
|
3747
|
|
POST
|
I don't see a way to edit the little window that gives you the short summary of what the tool does. I've filled out everything I see as relevant in the Edit Metadata tab. I filled out the Tags, Summary and Usage boxes. None of these are what I'm looking for. Here's my Backup Feature Services script tool in the Geoprocessing Pane. No summary. This tool, for example, has a summary:
... View more
06-09-2021
01:53 PM
|
0
|
0
|
943
|
|
POST
|
That's it, thanks! You can't forget to save in the Metadata tab to keep your changes, I noticed.
... View more
06-09-2021
01:18 PM
|
1
|
0
|
4517
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-25-2026 12:25 PM | |
| 1 | 05-04-2026 08:45 AM | |
| 1 | 04-20-2026 01:20 PM | |
| 1 | 07-24-2025 01:27 PM | |
| 1 | 11-13-2025 08:22 AM |
| Online Status |
Offline
|
| Date Last Visited |
Friday
|