|
POST
|
I have a feature layer representing electric utility structures, with a related table for inspections. I'm attempting to create a feature report with a record for each structure, along with information about the most recent inspection record in the related table as defined by a date field for the inspection date I've successfully used the Stats method with max to get the most recent inspection date, but I can't figure out how to call that variable in a where clause to define the values for the other fields coming from the related table. Any ideas would be much appreciated.
... View more
02-06-2023
05:52 PM
|
1
|
5
|
1653
|
|
POST
|
I'm seeing the exact same behavior. Takes up valuable real estate on mobile screens and provides no useful information to the user.
... View more
01-29-2023
11:49 AM
|
0
|
0
|
1104
|
|
POST
|
I figured it out. The request to add the item resources should look like this: with open(f"{tempdir}\\images\\image-resources-list.json", 'r') as f:
data = {
"fileName": "image-resources-list.json",
"resourcesPrefix": "images",
"access": "inherit",
"token": token,
"f": "json",
}
response = requests.post(url, data=data, files={"file": f})
print(response.json()) Note the addition of the files parameter with a dictionary to define the item resource to be added.
... View more
01-22-2023
05:08 PM
|
1
|
0
|
2046
|
|
POST
|
Thanks Robert. I ended up solving the issue, but your response helped point me in the right direction.
... View more
01-22-2023
05:04 PM
|
1
|
0
|
2046
|
|
POST
|
I'm attempting to use the addResources operation to upload JSON confiuguration files (e.g., config.json, image-resources-list.json, etc.) to a programatically-created ExB app, and keep running into issues. I've tried sending the JSON body in the Text parameter, sending the JSON body in the File parameter, sending as binary in the File parameter, all manner of encoding, and nothing works. I usually get a "Success" response from the addResources call, but when I attempt to list the item resources, they're empty. I feel like I'm missing something obvious. Here's one version of my Python code: import arcgis
from arcgis import GIS
import requests
gis = GIS('https://arcgis.com', username, password)
web_experience_item = gis.content.add(
{'type': 'Web Experience',
'title': 'New Experience',
'tags':'web experience'})
url = f"https://www.arcgis.com/sharing/rest/content/users/{username}/items/{web_experience_item.id}/addResources"
with open(f"{tempdir}//images//icon-resources-list.json", 'rb') as f:
data = {
"file": f, # also tried "text", also tried encoded json string
"fileName": "icon-resources-list.json",
"resourcesPrefix": "images",
"access": "inherit",
"token": token,
"f": "json"}
response = requests.post(url, data=data)
print(response.json()) # returns success
with open(f"{tempdir}//images//image-resources-list.json", 'rb') as f:
data = {
"file": f, # also tried "text", also tried encoded json string
"fileName": "image-resources-list.json",
"resourcesPrefix": "images",
"access": "inherit",
"token": token,
"f": "json"}
response = requests.post(url, data=data)
print(response.json()) # returns success
with open(f"{tempdir}//config//config.json", 'rb') as f:
data = {
"file": f, # also tried "text", also tried encoded json string
"fileName": "config.json",
"resourcesPrefix": "config",
"access": "inherit",
"token": token,
"f": "json"}
response = requests.post(url, data=data)
print(response.json()) # returns success
exb_item = gis.content.get(web_experience_id)
item_resources = exb_item.resources.list()
print(exb_resources) # empty list
response = requests.get(f"https://orgname.maps.arcgis.com/sharing/rest/content/items/{web_experience_id}/resources/config/config.json?f=json&token={token}")
print(response.json()) # 404 error because no resources exist
... View more
01-11-2023
01:47 PM
|
0
|
3
|
2164
|
|
POST
|
Hi David, It's possible to update typeKeywords through the Sharing API, with https://www.arcgis.com/sharing/rest/content/users/<user>/items/<item_id>/update ...or you can just use AGO Assistant or ArcGIS Assistant.
... View more
11-22-2022
02:04 PM
|
0
|
0
|
2594
|
|
POST
|
In addition to Russell's answer, another option is to publish vector tiles from Pro, which will give you a little more control over symbology and make the symbols available in 3.x maps/apps if needed.
... View more
11-15-2022
12:17 PM
|
0
|
1
|
3487
|
|
POST
|
Hey Aaron, I'm not sure what Esri's usage limits are, but another option could be to sleep for a few minutes between users: for user in user_list:
print(f'Inventorying items for user {user.username}')
user_items = gis.content.search(query=f'owner:{user.username}', max_items=10000)
for item in user_items:
if item.title.lower().startswith(search_term.lower()):
items.append(item)
time.sleep(300)
... View more
11-15-2022
11:43 AM
|
1
|
0
|
3239
|
|
POST
|
@LindaSlattery Use the Expression button, then enter "mailto:" + {your_email_field} as the expression.
... View more
11-15-2022
10:43 AM
|
3
|
2
|
3962
|
|
POST
|
Hey @AaronManuel2, The following should work, let me know if you run into issues or have questions. It searches by user, which helps sidestep the 10,000-item limitation (unless a single user has more than 10,000 items). It assumes that you only want to find items that *start with* your search term. from arcgis import GIS
import csv
import time
agol_username = '' # change
agol_password = '' # change
search_term = 'EAST' # change
output_csv = 'C://my_directory//my_csv.csv' # change
##############################
mygis = GIS('https://arcgis.com', agol_username, agol_password)
items = []
user_list = mygis.users.search(query='*', max_users=10000)
for user in user_list:
print(f'Inventorying items for user {user.username}')
user_items = gis.content.search(query=f'owner:{user.username}', max_items=10000)
for item in user_items:
if item.title.lower().startswith(search_term.lower()):
items.append(item)
with open(output_csv, 'w', encoding='utf-8') as file:
csvfile = csv.writer(file, delimiter=',', lineterminator='\n')
csvfile.writerow(["ID", # these are the headers; modify according to whatever properties you want in your report
"Title",
"Name",
"Owner",
"Sharing",
"Type",
"Created",
"Modified",
"Size",
"Views",
"URL",
"Tags",
"Description",
"Summary",
"Terms",
"Spatial Reference"
])
for item in items:
csvfile.writerow([item.id, # modify according to whatever properties you want in your report
item.title,
item.name,
item.owner,
item.access,
item.type,
time.strftime('%m/%d/%Y', time.localtime(item.created/1000)),
time.strftime('%m/%d/%Y', time.localtime(item.modified/1000)),
round(item.size/1000),
item.numViews,
item.url,
item.tags,
item.description,
item.snippet,
item.licenseInfo,
item.spatialReference
])
... View more
11-15-2022
09:54 AM
|
1
|
2
|
3254
|
|
POST
|
@LindaSlattery Did you click the button to the left of the URL box? It allows you to select an attribute from the connected data source:
... View more
11-15-2022
08:59 AM
|
1
|
4
|
3973
|
|
POST
|
Thanks @TonghuiMing; however, this is different from the way search tools work in all other Esri products and across the internet in general. The filtering behavior should be optional. The JS API Search widget does not automatically filter results, nor does the search functionality in the other 4.x configurable apps. The user preference you mention ("want to look at the previous result on the map while searching for a new one") is satisfied if you don't filter the results. I'm not talking about clearing the map features, I'm talking about being able to get results returned for a new search term. The average public user is expecting a Google Maps/Bing Maps experience. If I search for a restaurant by name in Google Maps, it doesn't filter other nearby restaurants. And if I want to search for a different restaurant, I simply start entering another search term.
... View more
11-15-2022
08:20 AM
|
7
|
1
|
5527
|
|
POST
|
Thanks @TonghuiMing, but it still doesn't work the way we need it to. It seems the user needs to clear the text by pressing delete or backspace. If they just highlight and start typing a new search term, which is how I believe most people would do it, it still returns no results. We would really love a search widget that just works like Web AppBuilder, which allows multiple successive searches no matter how the user interacts with it, because it doesn't filter the data. An option to open the popup like you can do in WAB would be nice as well.
... View more
11-11-2022
07:29 AM
|
2
|
3
|
5536
|
|
POST
|
Hi @EmilyHildebrand, this is an old post but in case it's helpful to you or anyone else, here's how to do that. This assumes you're searching a layer with addresses (instead of using a locator), and that the information you want in the popup is all in a single layer's popup configuration (either in a web map or on the service itself)*. If you want to pull popup configurations from several layers, or if you want to use a locator to search an address then find intersecting features for that address, I'd suggest using Zone Lookup. Add a Feature Info widget, then click "Select data" to set the layer you want to pull the popup from. This can be a layer in a map (which will use the layer's popup configuration as set in the web map), or you can pull the feature layer's default popup configuration by clicking "Add new data" and browsing to the service. Under "Source" in the Feature Info widget configuration panel, choose "Selected features" from the dropdown. Add the Search Widget, then click "New search source"->"Layer source" and add the layer with addresses you want to search. (If you don't want the features you're searching to be filtered by the Search Widget, create a data view of the layer and use that as the source.) On the Action tab in the Search Widget, add a trigger for "Record selection changes" On the Action tab in the Search Widget, click "Add action", select the Framework as the target, then choose "Select data records" and set your address layer from Step 2 as the Trigger data, then set the layer you want to pull the popup from as the Action data (these may be the same). On the Action tab in the Search Widget, click "Add action", select the Map as the target, then select "Zoom to". *You can pull information from multiple layers using Arcade FeatureSets into a single layer's popup configuration, but that's another topic.
... View more
10-29-2022
10:54 AM
|
4
|
5
|
9805
|
|
POST
|
You might also want to include a geopoint question inside the repeat, which will make a related layer instead of a related table, so you can just use the related layer in relevant apps (assuming you're copying the values for Existing 1-4 to the repeat). You can set the location of the repeat geopoint based on the parent geopoint with the following: pulldata(@"geopoint", ${name_of_parent_geopoint_question}, "y")+" "+pulldata(@"geopoint", ${name_of_parent_geopoint_question}, "x")
... View more
10-27-2022
01:13 PM
|
1
|
0
|
690
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-24-2024 12:44 PM | |
| 1 | 08-13-2024 11:31 AM | |
| 1 | 02-06-2023 05:52 PM | |
| 1 | 09-05-2020 01:13 PM | |
| 2 | 12-24-2024 11:19 AM |
| Online Status |
Offline
|
| Date Last Visited |
09-16-2025
04:51 PM
|