POST
|
@DennisKaplan3333333333 are you using a hosted feature? https://support.esri.com/en-us/knowledge-base/faq-is-there-an-undo-option-when-editing-a-hosted-featu-000027548 Here is an esri Idea https://community.esri.com/t5/arcgis-online-ideas/need-undo-for-editing-in-arcgis-online/idi-p/938290
... View more
yesterday
|
0
|
0
|
77
|
POST
|
@HanliePetoors To create a QR code that will open the Field Map and zoom to a specific feature, you can use the search URL parameter. Here's an example of how to structure this URL: https://www.arcgis.com/apps/instant/field-maps/index.html?appid=YOUR_MAP_APP_ID&search=YOUR_SEARCH_TERM Replace YOUR_MAP_APP_ID with the ID of your web map and YOUR_SEARCH_TERM with the term you want to search for. Example Let's say you have a feature layer of parks, and you want to zoom to "Central Park." You would configure the search fields to include the name of the park. The URL might look like this: https://www.arcgis.com/apps/instant/field-maps/index.html?appid=abcd1234&search=Central%20Park
... View more
yesterday
|
0
|
0
|
22
|
POST
|
@SaraFrankenfeld Looks like other people are having an issue too: https://community.esri.com/t5/arcgis-experience-builder-questions/print-widgit-breaking-after-june-2024-update/m-p/1498985#M13418
... View more
yesterday
|
0
|
1
|
22
|
POST
|
@DiptiDhar Have you looked at this help doc? https://pro.arcgis.com/en/pro-app/latest/help/editing/clip-features-using-another-feature.htm
... View more
|
0
|
2
|
94
|
DOC
|
@JakeSkinner That got it to run! Thank you! Took way longer then expected and loaded a bunch of data then froze a few times. I am not sure why it keeps freezing. I tired running at a shorter interval (5min) and it still hangs up. I am afraid that if I run this on task scheduler that it will break my server. Any ideas? I think it might be loading all features and there are over 1000 Edit: Before I edited the code it would just load the features that were created last and send an email. I am not sure what has changed besides logging in. EDIT EDIT: I took out the print(response) and it fixed the issue.
... View more
05-15-2024
01:04 PM
|
0
|
0
|
604
|
DOC
|
@JakeSkinnerThe token printed! after the token I got this error: {'returnGeometry': 'false', 'outFields': '*', 'statisticType': 'count', 'where': '1=1', 'f': 'pjson'} {u'error': {u'message': u'Token Required', u'code': 499, u'details': []}} Traceback (most recent call last): File "C:\Users\user\Desktop\TestEmailSend.py", line 69, in <module> for feat in response['features']: KeyError: 'features'
... View more
05-15-2024
11:22 AM
|
0
|
0
|
634
|
DOC
|
@JakeSkinnerI dont think we have that enabled. I have to sign in sometimes
... View more
05-15-2024
10:21 AM
|
0
|
0
|
659
|
DOC
|
@JakeSkinner I removed Email and username and passwords etc I changed the AGOL section using the code you provided above import requests, json, datetime, time, smtplib
from datetime import timedelta
import datetime
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
# Disable warnings
requests.packages.urllib3.disable_warnings()
print('This file is from testemailsend.py')
# Variables
username = 'username' # AGOL Username or Portal username
password = 'password' # AGOL Password or Portal password
URL = 'https://gis.ashland.or.us/arcgis/rest/services/Hosted/wildlife_reporter/FeatureServer/0/query' # Feature Service URL
uniqueID = 'fid' # i.e. OBJECTID
dateField = 'created_date' # Date field to query
hoursValue = 24 # Number of hours to check when a feature was added 0.08285 is 5 min
fromEmail = 'gis@ashland.or.us' # Email sender
TO = ['MyEmail'] # Email receiver
smtpServer = '**' # SMTP Server Name
portNumber = ** # SMTP Server port
AGOL = True # True if service is hosted in AGOL, False if service is hosted in Portal
portalServer = 'ServerName' # Server name portal is installed on (not web adaptor)
# Create empty list for uniqueIDs
datesighted = []
name = []
phone = []
email = []
aggressive = []
numanimal = []
animaldoing = []
reaction = []
probtype = []
oidList = []
publicview = []
details = []
# Generate AGOL token
if AGOL == True:
try:
print('Generating Token')
tokenURL = 'https://gis.ashland.or.us/arcgis/sharing/rest/generateToken/'
params = {'f': 'pjson', 'username': username, 'password': password, 'referer': 'https://gis.ashland.or.us/portal'}
r = requests.post(tokenURL, data=params, verify=False)
response = json.loads(r.content)
token = data['token']
print(token)
except:
token = ''
else:
# Generate Portal token
tokenURL = 'https://gis.ashland.or.us/portal/arcgis/sharing/rest/generateToken/'.format(portalServer)
params = {'f': 'pjson', 'username': username, 'password': password, 'referer': 'https://gis.ashland.or.us/portal'.format(portalServer)}
r = requests.post(tokenURL, data = params, verify=False)
response = json.loads(r.content)
token = response['token']
print(token)
# Query service and check if created_date time is within the last hour
params = {'f': 'pjson', 'where': "1=1", 'outFields' : '*', 'statisticType' : 'count', 'returnGeometry' : 'false'}
r = requests.post(URL, data=params, verify=False)
response = json.loads(r.content)
print(params)
print(response)
for feat in response['features']:
createDate = feat['attributes']['created_date']
createDate = int(str(createDate)[0:-3])
t = datetime.datetime.now() - timedelta(hours=hoursValue)
t = time.mktime(t.timetuple())
if createDate > t:
datesighted.append(str(feat['attributes']['datesighte']))
name = (str(feat['attributes']['name']))
phone = (str(feat['attributes']['phone']))
email = (str(feat['attributes']['email']))
animaldoing = (str(feat['attributes']['animaldoin'])).replace(u"\u2018", "'").replace(u"\u2019", "'")
numanimal = (str(feat['attributes']['numanimal']))
if isinstance(aggressive, list):
aggressive = ', '.join(aggressive)
aggressive = aggressive.encode('utf-8')
reaction = str(feat['attributes']['reaction']).replace(u"\u2018", "'").replace(u"\u2019", "'")
probtype = (str(feat['attributes']['probtype']))
oidList = (str(feat['attributes']['fid']))
details = (str(feat['attributes']['details'])).replace(u"\u2018", "'").replace(u"\u2019", "'")
publicview = (str(feat['attributes']['publicview']))
print(oidList)
mergelist = zip(probtype, details, publicview)
print(mergelist)
# Email Info
FROM = fromEmail
SUBJECT = 'New Wildlife Sighting Has been Reported'
Total= "Features with " + " " + str(publicview) + " " + " were added."
TotalAnimals = (Total.count("Yes"))
print(TotalAnimals)
#TEXT = "There were " + " " + str(TotalAnimals) + " " + " sighting(s) added the Cougar Map within the past hour."
#TEXT = '<a href="http://maps.google.com/maps?z=12&t=m&q=loc:'+str(p['latitude'])+'+'+str(p['longitude'])+'">Click Here</a>'
tom = datesighted[0]
chosen_number = int(tom)
s = chosen_number / 1000.0
print s
dFormat = "%Y-%m-%d %H:%M:%S.%f"
datesightedconvert = datetime.datetime.fromtimestamp(s).strftime('%Y-%m-%d %H:%M:%S')
# Create the body of the message (a plain-text and an HTML version).
#TotalSighted = "There were " + " " + str(TotalAnimals) + " " + " reports(s) added the Wildlife Map within the past 5 min."
TotalSighted = "A Report has been added the Wildlife Map within the past 5 min."
Sighted = "\nAnimal Sighted : " + str(probtype)
TheDateSighted = "\nDate Sighted : " + str(datesightedconvert) + " " + " \n"
reported = "\nReporter Name: " + str(name)
PhoneNumber = "\nReporter Phone Number: " + str(phone)
ReportedEmail = "\nReporter Phone Email: " + str(email)
Aggressiveness = "\nWas animal Aggressive?: " + str(aggressive)
ReportedReaction = "\nWhat was the animal Reaction?: " + str(reaction)
ReportedDetails = "\nMore Details about the sighting: " + str(details)
AnimalDoing = "\nWhat was the Animal(s) Doing?: " + str(animaldoing)
AnimalSeen = "\nHow Many were seen?: " + str(numanimal)
Link = "\n\nView more information on the Cougar Webmap: \nhttps://gis.ashland.or.us/cougar \n\n\n "
Text = TotalSighted + TheDateSighted + Sighted + reported + PhoneNumber + ReportedEmail + Aggressiveness + ReportedReaction + ReportedDetails + AnimalDoing + AnimalSeen + Link
print ''.join(Text)
message = """\
From: %s
To: %s
Subject: %s
%s
""" % (FROM, ", ".join(TO), SUBJECT, Text)
# If new features exist, send email
if len(oidList) > 0:
smtpObj = smtplib.SMTP(host=smtpServer, port=portNumber)
smtpObj.sendmail(FROM, TO, message)
print("Successfully sent email")
smtpObj.quit()
... View more
05-15-2024
09:51 AM
|
0
|
0
|
670
|
DOC
|
@JakeSkinner This file is from testemailsend.py Generating Token {'returnGeometry': 'false', 'outFields': '*', 'statisticType': 'count', 'where': '1=1', 'f': 'pjson'} {u'error': {u'message': u'Token Required', u'code': 499, u'details': []}} Traceback (most recent call last): File "C:\Users\user\Desktop\TestEmailSend.py", line 68, in <module> for feat in response['features']: KeyError: 'features'
... View more
05-15-2024
08:25 AM
|
0
|
0
|
699
|
DOC
|
@JakeSkinner I now get this error Traceback (most recent call last): File "C:\Users\user\Desktop\TestEmailSend.py", line 68, in <module> for feat in response['features']: KeyError: 'features'
... View more
05-15-2024
08:19 AM
|
0
|
0
|
712
|
DOC
|
@JakeSkinner Yes it is shared with organization only now.
... View more
05-15-2024
07:00 AM
|
0
|
0
|
740
|
DOC
|
I am using enterprise portal and my script does not seem to work now. We have decided to lock down the service to only internal employees and now the script fails. I am using a variation of the script @JakeSkinner provided. I thought it worked but now that ii is locked down it is not. Any suggestions on why its not working?
... View more
05-14-2024
12:45 PM
|
0
|
0
|
786
|
POST
|
https://community.esri.com/t5/arcmap-blog/arcmap-enters-mature-support-in-march-2024/ba-p/1299695 Have you tried pro? I am growing to love it more and more
... View more
05-02-2024
07:56 AM
|
0
|
0
|
191
|
Title | Kudos | Posted |
---|---|---|
2 | 04-11-2024 06:33 AM | |
1 | 04-05-2024 03:01 PM | |
4 | 02-13-2024 02:33 PM | |
1 | 10-08-2020 01:34 PM | |
1 | 10-06-2020 07:32 AM |