DOC
|
@James_Shreeve try the below. You will want to add all the users you want notified to a Group in AGOL. Then, update the allUsersGroupID variable in the script with ID of that Group. from arcgis.gis import GIS
from arcgis.features import FeatureLayer
import datetime, time
from datetime import timedelta
# Variables
fsURL = 'https://services6.arcgis.com/h0X6cdaELg2mgWNZ/arcgis/rest/services/My_Sites_Copy/FeatureServer/0'
dateField = 'Agreement_Date_End'
months = 6
allUsersGroupID = '0a7e3ca5f5814ed884cbab31abb465bf'
emailSubject = 'Agreement Date'
emailMessage = 'Some message to include in e-mail'
# Generate AGOL
print('Connecting to AGOL')
gis = GIS("home")
# Get group members
allUsersGroup = gis.groups.get(allUsersGroupID)
userList = allUsersGroup.get_members()['users']
# Reference feature service from url
fLyr = FeatureLayer(fsURL)
# Query service and check if date field is within the last hour
print("Querying feature service")
queryResults = fLyr.query(where='1=1', out_fields="*", return_geometry=False)
for results in queryResults.features:
if results.attributes[dateField] != None:
createDate = results.attributes[dateField] / 1000
t = datetime.datetime.now() + timedelta(months=months)
t = time.mktime(t.timetuple())
if createDate > t:
# Send e-mail
print('Sending e-mail')
allUsersGroup.notify(users=userList, subject=emailSubject, message=emailMessage)
... View more
Thursday
|
0
|
0
|
36
|
DOC
|
@TarigAhmedTXHSDS, This column should be populated if you have any Application licenses (i.e. ArcGIS Pro, Insights, Field Maps, etc) assigned to the user. Ex:
... View more
Thursday
|
0
|
0
|
14
|
DOC
|
@Samuel_McAuley @MiriEshel1 I have not tested this changing database types (i.e. SQL Server --> PostgreSQL) so I cannot guarantee this will work at the moment. @Samuel_McAuley when you are attempting to change the database, does each database have the same users and permissions/privileges as the other?
... View more
Monday
|
0
|
0
|
108
|
DOC
|
@James_Shreeve can you share the service you are working with to a Group in AGOL and invite my user account: jskinner_rats. If you are able to, please indicate which date field you are looking to query, and how you plan on obtaining the e-mail addresses to notify.
... View more
Monday
|
0
|
0
|
88
|
DOC
|
@James_Shreeve yes, this would work. When using a group to notify users, as in this document, all users will be notified that are in the group. Not sure if this is what you're looking for, or to simply notify an individual user based on the particular feature. Here is a document that shows how to query a feature service based on a date field.
... View more
2 weeks ago
|
0
|
0
|
191
|
DOC
|
@James_Shreeve is the email address in another field within the feature service?
... View more
2 weeks ago
|
0
|
0
|
263
|
POST
|
Hi @MaikeObenhaus, Are you able to register the geodatabase/folder where the data resides with ArcGIS Server? If you can, you can publish as a referenced Map Image, and the service will automatically update.
... View more
3 weeks ago
|
0
|
0
|
147
|
POST
|
@JustinNettleton1 instead of Longitude/Latitude for your geometry, try x/y. Ex: unit_dict = {"attributes":
{"id":call[0],
"Unit":call[1],
"Status":call[2],
"StatusCategory":call[3],
"StatusRank":call[4],
"OOSReason":call[5],
"StatusChange":call[6],
"Type":call[7],
"Juridiction":call[8].upper(),
"Division":call[9],
"LastUpdate":call[10]},
"geometry":
{"x": call[11], "y": call[12]}}
... View more
3 weeks ago
|
0
|
1
|
216
|
DOC
|
@DJB you can update the sharing with the following: from arcgis.gis._impl._content_manager import SharingLevel
sharing_mgr = fs.sharing
if shrOrg:
sharing_mgr.sharing_level = SharingLevel.ORG
if shrEveryone:
sharing_mgr.sharing_level = SharingLevel.EVERYONE
if shrGroups:
for groupID in shrGroups:
group = gis.groups.get(groupID)
item_grp_sharing_mgr = sharing_mgr.groups
item_grp_sharing_mgr.add(group=group) I did notice if the sharing is already set on the feature service, you can omit this entirely and it will be maintained. I can't recall if it use to do this or not at earlier versions of the API.
... View more
3 weeks ago
|
0
|
0
|
178
|
DOC
|
@Le1Hod can you share the hosted feature service you are updating with me to an AGOL Group? You can invite my AGOL account, jskinner_rats, to this Group.
... View more
3 weeks ago
|
0
|
0
|
220
|
DOC
|
@GavinRunyon it still works at 11.1. I went ahead and updated the name of the zip file to avoid future confusion.
... View more
3 weeks ago
|
0
|
0
|
448
|
POST
|
Hi @GregMattisGov, Take a look at the scripts in the below link. I've used this solution for several customers to migrate built-in accounts to enterprise (active directory or SAML) accounts. It should work the same going from SAML to SAML, and it will migrate the add-on licenses (i.e. Pro) as well. https://community.esri.com/t5/arcgis-enterprise-documents/migrate-built-in-named-user-accounts-to-enterprise/ta-p/1269974
... View more
05-22-2024
05:10 AM
|
0
|
0
|
131
|
POST
|
@JustinNettleton1 do you have ArcGIS Pro? You may be able to simplify this with a truncate/append. https://community.esri.com/t5/arcgis-online-documents/overwrite-arcgis-online-feature-service-using/ta-p/904457
... View more
05-22-2024
04:09 AM
|
0
|
0
|
234
|
POST
|
Hi @RehanChaudhary, I haven't used this processor, yet, but you could see if this calculates the speed correctly: https://github.com/Esri/motion-calculator-for-geoevent
... View more
05-20-2024
10:29 AM
|
0
|
0
|
92
|
DOC
|
@anonymous55 go to Organization > Members > Add Members: There you will have an option to create a Built-in account:
... View more
05-20-2024
07:27 AM
|
0
|
0
|
607
|
Title | Kudos | Posted |
---|---|---|
1 | 03-16-2022 10:25 AM | |
1 | 12-11-2019 05:22 AM | |
1 | 05-14-2024 11:04 AM | |
2 | 05-13-2024 05:23 AM | |
1 | 05-13-2024 04:17 AM |
Online Status |
Online
|
Date Last Visited |
8 hours ago
|