<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Generate/send email when a feature is added to a hosted service in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706288#M54666</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is excellent Jake!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only I would need to tweak it to check for changes in certain fields + changes since the last time it was checked....which might just be daily (so changes in the last 24 hours instead of 1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you tell my the syntax for setting up those queries (or point me to resources)?&lt;/P&gt;&lt;P&gt;Also, I'm not sure where to run this code from. I'm a bit familiar with Python but this doesn't look like it. A few pointers please on how to run this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Feb 2015 14:06:28 GMT</pubDate>
    <dc:creator>ChandreyeeLahiri</dc:creator>
    <dc:date>2015-02-26T14:06:28Z</dc:date>
    <item>
      <title>Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706285#M54663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to have an email sent (to a list of recipients) whenever a point is added to a hosted File GDB on a public web-app?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The idea is to originate a permit application process from a web-map/app: applicants can add a point for the location they need a permit for, enter their information and apply for a permit (of particular kind). An email alerts officials that a permit has been applied for. The rest of the approval process flow from there and the hosted data is used to collect applicant information (including location for permit) as well as flag the status of the application as it makes its way through various stages of the approval process.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on how to have edits trigger emails?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2015 17:47:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706285#M54663</guid>
      <dc:creator>ChandreyeeLahiri</dc:creator>
      <dc:date>2015-02-24T17:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706286#M54664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chandreyee,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are tracking edits within the hosted feature service, you could have Windows Task Scheduler check the service at a given time interval (i.e. once an hour) and check for any new features that were added within the last hour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is an example on how to do this.&amp;nbsp; The service is tracking edits, where new features are recorded in a field called 'created_date'.&amp;nbsp; The script queries the service and checks this field and compares it to the current time (minus one hour).&amp;nbsp; If the time is greater than the current time, it will send an e-mail of the OBJECTIDs of the new features.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import urllib2, json, urllib, datetime, time, smtplib
from datetime import timedelta

oidList = []

&lt;SPAN&gt;URL = '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://services.arcgis.com/Fz6JUji5ArUSDM/arcgis/rest/services/Airports/FeatureServer/0/query" rel="nofollow noopener noreferrer" target="_blank"&gt;http://services.arcgis.com/Fz6JUji5ArUSDM/arcgis/rest/services/Airports/FeatureServer/0/query&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;
params = {'f': 'pjson', 'where': "1=1", 'outfields' : 'OBJECTID, created_date', 'returnGeometry' : 'false'}
req = urllib2.Request(URL, urllib.urlencode(params))
response = urllib2.urlopen(req)
data = json.load(response)
for feat in data['features']:
&amp;nbsp;&amp;nbsp;&amp;nbsp; createDate = feat['attributes']['created_date']
&amp;nbsp;&amp;nbsp;&amp;nbsp; createDate = int(str(createDate)[0:-3])
&amp;nbsp;&amp;nbsp;&amp;nbsp; t = datetime.datetime.now() - timedelta(hours=1)
&amp;nbsp;&amp;nbsp;&amp;nbsp; t = time.mktime(t.timetuple())
&amp;nbsp;&amp;nbsp;&amp;nbsp; if createDate &amp;gt; t:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oidList.append(feat['attributes']['OBJECTID'])

&lt;SPAN&gt;FROM = &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:'sender@hotmail.com" rel="nofollow noopener noreferrer" target="_blank"&gt;'sender@hotmail.com&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;
&lt;SPAN&gt;TO = [&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:'receiver@yahoo.com" rel="nofollow noopener noreferrer" target="_blank"&gt;'receiver@yahoo.com&lt;/A&gt;&lt;SPAN&gt;']&lt;/SPAN&gt;
SUBJECT = 'New Feature Added'
TEXT = "Features with OBJECTIDs " + str(oidList) + " were added."

message = """\
From: %s
To: %s
Subject: %s

%s
""" % (FROM, ", ".join(TO), SUBJECT, TEXT)

smtpObj = smtplib.SMTP(host='smtp.hotmail.com', port=25)
smtpObj.sendmail(FROM, TO, message)
print "Successfully sent email"
smtpObj.quit()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:40:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706286#M54664</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-12T05:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706287#M54665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could also try using some of the Marketplace applications that have been developed to do this as well. For example, Esri UK have developed the QuestionWhere Builder that allows you to get the user to fill out a survey and add points to a map before submitting it as a new point to the feature service. This can also be used to send an email to an email alias or individual:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://marketplace.arcgis.com/listing.html?id=ef411f82398b483a9ee2a421bb45bada" title="https://marketplace.arcgis.com/listing.html?id=ef411f82398b483a9ee2a421bb45bada"&gt;https://marketplace.arcgis.com/listing.html?id=ef411f82398b483a9ee2a421bb45bada&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 10:52:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706287#M54665</guid>
      <dc:creator>AndySmith</dc:creator>
      <dc:date>2015-02-26T10:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706288#M54666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is excellent Jake!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only I would need to tweak it to check for changes in certain fields + changes since the last time it was checked....which might just be daily (so changes in the last 24 hours instead of 1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you tell my the syntax for setting up those queries (or point me to resources)?&lt;/P&gt;&lt;P&gt;Also, I'm not sure where to run this code from. I'm a bit familiar with Python but this doesn't look like it. A few pointers please on how to run this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 14:06:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706288#M54666</guid>
      <dc:creator>ChandreyeeLahiri</dc:creator>
      <dc:date>2015-02-26T14:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706289#M54667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Andy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This looks like a wonderful resource though the price tag is fairly steep. It gets to my goal of capturing information from the public using a map and using it in AGOL to follow a workflow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are there any ESRI free apps that come anywhere close to this?&lt;/P&gt;&lt;P&gt;Where do I go to browse the various free apps for downloads?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 14:09:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706289#M54667</guid>
      <dc:creator>ChandreyeeLahiri</dc:creator>
      <dc:date>2015-02-26T14:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706290#M54668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chandreyee, I don't think there is anything free that is comparable to QuestionWhere Builder at the moment, if there was, then people wouldn't pay for QuestionWhere Builder! You can check yourself by searching the Marketplace: &lt;A href="https://marketplace.arcgis.com/" title="https://marketplace.arcgis.com/"&gt;https://marketplace.arcgis.com/&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get a free trial and test it out would be my suggestion, and you can make a decision from there as to whether you would like to pay for QuestionWhere, or spend time developing something yourself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 14:29:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706290#M54668</guid>
      <dc:creator>AndySmith</dc:creator>
      <dc:date>2015-02-26T14:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706291#M54669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That app doesn't fully address our needs though (rather, it has bells and whistles we may not want to pay for) so I'd like to see what other closer solutions exist. Right now, I've only tried out the free ESRI apps that i get when I go to make an app from a web-map in AGOL...was wondering if there are others like that anywhere else.&lt;/P&gt;&lt;P&gt;I take it that's it for freeware?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Will definitely do the free trial as you suggest. The annual cost might still be more cost-efficient than contracting out for a solution (since we don't have much app development skills in-house).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 14:33:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706291#M54669</guid>
      <dc:creator>ChandreyeeLahiri</dc:creator>
      <dc:date>2015-02-26T14:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706292#M54670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jake - &lt;/P&gt;&lt;P&gt;Thank you for posting this as an example! Not sure why your response was not marked as the "correct answer", but nonetheless the OP's question and your response helped me tremendously.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wanted to add that if someone were to implement your code as-is and set up a scheduled task to run every hour, the script would generate an email every hour regardless if there were new features added or not.&amp;nbsp; Or maybe I've set something up wrong with the scheduled task?&amp;nbsp; Regardless, to fix the problem I encountered - I simply added an if-else statement that checked to see if the list was empty, if so, do nothing, if not, send the email.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is an extremely useful piece of code and saved me tons of dev time and head-banging, and have implemented it for a few of our data collection projects that use our locally hosted ArcGIS Server secured feature services (not esri hosted feature services). E.g. Very useful for services involved in our Crowdsource Reporter apps to generate emails to relevant Programs when new features are added. Thanks again for your post, Jake.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Ryan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jan 2016 20:47:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706292#M54670</guid>
      <dc:creator>RyanNosek</dc:creator>
      <dc:date>2016-01-13T20:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706293#M54671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jake,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm really interested by using this script for many of our features services but our datas aren't on Arcgis Online, They are on a 10.4 Portal.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm really new in python but i'm asking if this is possible to do the same on non-public feature service. And if this is possible, have you some tips please ? I don't really know when I have to place the token generated etc..&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;thx in advance,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Best Regards&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Rémi&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 15:43:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706293#M54671</guid>
      <dc:creator>RemiFoicik</dc:creator>
      <dc:date>2016-08-29T15:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706294#M54672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Remi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work with Portal for ArcGIS as well.&amp;nbsp; You will just need to update the URL (line 6) to the feature service you are monitoring.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 16:07:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706294#M54672</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2016-08-29T16:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706295#M54673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, Thanks you for your answer.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm actually trying with the service shared with everyone.&amp;nbsp;&lt;BR /&gt;Unfortunately, I get this when I'm trying to run the script &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;IMG class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/218446_Capture.PNG" style="width: 620px; height: 333px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 16:29:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706295#M54673</guid>
      <dc:creator>RemiFoicik</dc:creator>
      <dc:date>2016-08-29T16:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706296#M54674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check your service/feature calss, do you have this field ("created_date") in your dataset? Usually this field is created when you enable editor tracking on your sde gdb.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 16:32:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706296#M54674</guid>
      <dc:creator>RyanNosek</dc:creator>
      <dc:date>2016-08-29T16:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706297#M54675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does your feature service have editor tracking enabled?&amp;nbsp; If so, does the field 'created_date' exist?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 16:33:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706297#M54675</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2016-08-29T16:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706298#M54676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately Yes &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/218489_Capture2.PNG" style="width: 620px; height: 126px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 16:35:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706298#M54676</guid>
      <dc:creator>RemiFoicik</dc:creator>
      <dc:date>2016-08-29T16:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706299#M54677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure what's happening with this service.&amp;nbsp; When I try and query it, and include to return all the fields, only the 'OBJECTID' field is returned:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;URL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsig.versaillesgrandparc.fr%2Farcgis%2Frest%2Fservices%2FHosted%2FNicolli_Rapports%2FFeatureServer%2F0%2Fquery" target="_blank"&gt;http://sig.versaillesgrandparc.fr/arcgis/rest/services/Hosted/Nicolli_Rapports/FeatureServer/0/query&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;
params &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'f'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'json'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'where'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"1=1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'outfields'&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'*'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
req &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Request&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;URL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlencode&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;params&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
response &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlopen&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;req&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; json&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;load&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;response&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; feat &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; data&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'features'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; feat&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'attributes'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would test the above script on other services to see if other fields are returned other than just the 'objectid'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:40:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706299#M54677</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-12T05:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706300#M54678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I saw that on Fiddler &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;But I get the created_date attributes when I'm doing the query manually on the Sharing/Rest&lt;BR /&gt;&lt;BR /&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/218491_Capture3.PNG" style="width: 620px; height: 721px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 17:24:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706300#M54678</guid>
      <dc:creator>RemiFoicik</dc:creator>
      <dc:date>2016-08-29T17:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706301#M54679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe could I have more chance working directly with Querys from sharing/rest like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://sig.versaillesgrandparc.fr/arcgis/rest/services/Hosted/Rapports_Nicollin/FeatureServer/0/query?where=1%3D1&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;distance=&amp;amp;units=esriSRUnit_Foot&amp;amp;relationParam=&amp;amp;outFields=*&amp;amp;returnGeometry=true&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;gdbVersion=&amp;amp;returnDistinctValues=false&amp;amp;returnIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;returnExtentOnly=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=&amp;amp;outStatistics=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;multipatchOption=&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;f=pjson" title="http://sig.versaillesgrandparc.fr/arcgis/rest/services/Hosted/Rapports_Nicollin/FeatureServer/0/query?where=1%3D1&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;distance=&amp;amp;units=esriSRUnit_Foot&amp;amp;relationParam=&amp;amp;outFields=*&amp;amp;returnGeometry=true&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;gdbVersion=&amp;amp;returnDistinctValues=false&amp;amp;returnIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;returnExtentOnly=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=&amp;amp;outStatistics=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;multipatchOption=&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;f=pjson"&gt;http://sig.versaillesgrandparc.fr/arcgis/rest/services/Hosted/Rapports_Nicollin/FeatureServer/0/query?where=1%3D1&amp;amp;object…&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for your time, I will try to understand how to make python working with that&amp;nbsp;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 19:39:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706301#M54679</guid>
      <dc:creator>RemiFoicik</dc:creator>
      <dc:date>2016-08-29T19:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706302#M54680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the format for crafting a query with your script. &amp;nbsp;Say I had a field named STATUS and a field named TYPE and I wanted to query records where: &amp;nbsp;[TYPE] = 'POTHOLE' and [STATUS] = 'OPEN' &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried various combinations like below but have had no luck. &amp;nbsp;Is there any chance anyone has done this before and could help. &amp;nbsp;Thanks!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;params = {'f': 'pjson', 'where': "1=1 and 'REQUEST_TYPE' = 'PW (SM)-Potholes'", 'outfields' : 'OBJECTID, created_date, SUMMARY, ADDRESS1', 'returnGeometry' : 'false'}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2016 15:03:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706302#M54680</guid>
      <dc:creator>EdwardHankins</dc:creator>
      <dc:date>2016-12-07T15:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706303#M54681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you haven't figured this this out already the correct syntax should be:&lt;/P&gt;&lt;P&gt;params = {'f': 'pjson', 'where': "(REQUEST_TYPE)='&lt;SPAN style="background-color: #ffffff;"&gt;PW (SM)-Potholes&lt;/SPAN&gt;'", 'outfields' : '*', 'returnGeometry' : 'false'}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2017 15:35:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706303#M54681</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-01-12T15:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Generate/send email when a feature is added to a hosted service</title>
      <link>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706304#M54682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check! &amp;nbsp;I actually figured it out by hitting the query web page and trying various combinations but thank you very much for your answer!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2017 18:41:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/generate-send-email-when-a-feature-is-added-to-a/m-p/706304#M54682</guid>
      <dc:creator>EdwardHankins</dc:creator>
      <dc:date>2017-01-12T18:41:00Z</dc:date>
    </item>
  </channel>
</rss>

