POST
|
Needed to add the token in the HTTP Get a File call:
... View more
07-06-2022
09:05 AM
|
0
|
0
|
382
|
POST
|
I have a Make (aka Integromat) Scenario that generates a Feature Report and emails it, but I also need to include any files that were uploaded in the survey (attachments will be pdf not photos). I grab the URL through a HTTP Get File call and map it as an attachment in the email however I get a JSON file returned in my email instead of the attachment (PDF). Do I need to parse the JSON after the HTTP Get File, how would I write the schema for that? Thanks for any help!
... View more
07-06-2022
07:50 AM
|
1
|
1
|
442
|
POST
|
@Anonymous User Thanks for your help and explaining that. It looks like my real error is further down in the email portion.
... View more
03-02-2022
06:44 AM
|
0
|
0
|
1071
|
POST
|
@Anonymous User Thanks for your response, but I do have that configured like your example shows:
... View more
03-01-2022
01:45 PM
|
0
|
0
|
1097
|
POST
|
Following along with this blog here I set up a power automate flow for a hosted feature layer, and the flow runs until the "Get Edits" step where I get the following error: <html><head><title>Object moved</title></head><body> <h2>Object moved to <a href="https://arcgisazureprod5.blob.core.windows.net/replicafiles/...">here</a>.</h2> </body></html> I am not using a Damage Assessment template layer like the blog, just an editable hosted feature layer with editor tracking turned on. Any help would be much appreciated!!
... View more
03-01-2022
12:54 PM
|
0
|
4
|
1131
|
POST
|
@Anonymous User I've been following along to your Dev Summit video for Hosted Feature Layer Webhooks (which is awesome, and just what I needed!), but I keep getting stuck at the same point in the process. I'm having trouble registering the app and getting the Oauth 2 in Integromat to connect. Following along with your example of creating an app, registering it, I get the pop up to log in with my credentials, but then I get the following blue screen error. Any help would be much appreciated! "\n\n\n\n\n\n\n\n<html>\n\n\n\n\n\n\n<head>\n<title>\nError: Invalid URL</title>\n<link href=\"/sharing/rest/files/gw.css\" rel=\"stylesheet\" type=\"text/css\"/>\n</head>\n\n<body>\n\n<table width=\"100%\" class=\"topTable\">\n<tr valign=\"top\">\n<td>\n<b>ArcGIS Portal Directory</b>\n\n</td>\n<td align=\"right\">\n\n</td>\n</tr>\n</table>\n\n<table class=\"navTable\" width=\"100%\"><tr><td class=\"breadcrumbs\">Error</td></tr></table>\n\n<div class=\"gwDiv\">\n\n<h3>Invalid URL</h3><br/>\n\n<b>Error: </b>400<br/><br/>\n\n\n\n</div>\n\n</body>\n\n</html>\n"
... View more
02-08-2022
12:06 PM
|
0
|
1
|
1019
|
POST
|
Hi @DanteLee I ended up using python scripts/ Windows Task Scheduler to get the email notifications up and running. Never could get it to work, although I do plan on taking a look at it again with fresh eyes here soon. Thanks!
... View more
05-10-2021
12:41 PM
|
0
|
1
|
1185
|
POST
|
Once I decided to go the python route with Windows Task Scheduler I was up and running and have had no issues. I can share my scripts if you're interested, just let me know.
... View more
04-14-2021
07:50 AM
|
0
|
2
|
2252
|
POST
|
@JulieK No I ended up using python scripts to generate the email notifications.
... View more
04-13-2021
08:57 AM
|
0
|
4
|
2261
|
DOC
|
@JakeSkinner Thank you so much for your help! That worked!!
... View more
04-05-2021
08:13 AM
|
0
|
0
|
6627
|
DOC
|
@JakeSkinner I've got the script working great for new updates using the "CreationDate" field. But I'm trying to revise the script to use the "EditDate" field to capture only updates, i.e.: if editDate is not None and editDate != createDate: The json response pulls the correct Objectid of the most recently updated feature, but the fields in the email output are from the newest feature added. Any help would be much appreciated! Thanks! code minus the credentials: import requests, json, datetime, time, smtplib, math from datetime import timedelta from email.mime.text import MIMEText # Disable warnings requests.packages.urllib3.disable_warnings() # Variables username = '' # AGOL Username password = '' # AGOL Password URL = 'https://services5.arcgis.com/lt8CbgYaNuFrQ7kB/arcgis/rest/services/CitizenProblems_b11a3a634eea4fa09192e6372a59daa5/FeatureServer/0/query' # Feature Service URL uniqueID = 'OBJECTID' # i.e. OBJECTID dateField1 = 'CreationDate' # Date field to query dateField2 = 'EditDate' # Date field to query hoursValue = 1 # Number of hours to check when a feature was added fromEmail = '' # Email sender smtpServer = '' # SMPT Server Name portNumber = 25 # SMTP Server port # Create empty list for uniqueIDs oidList = [] updateFC = [] # Generate AGOL token try: print('Generating Token') tokenURL = 'https://www.arcgis.com/sharing/rest/generateToken' params = {'f': 'pjson', 'username': username, 'password': password, 'referer': 'http://www.arcgis.com'} r = requests.post(tokenURL, data=params, verify=False) response = json.loads(r.content) token = response['token'] except: token = '' # Return largest ObjectID whereClause = '1=1' params = {'where': whereClause, 'returnIdsOnly': 'true', 'token': token, 'f': 'json'} r = requests.post(URL, data = params, verify = False) response = json.loads(r.content) try: response['objectIds'].sort() except Exception as e: print("Error: {0}".format(e)) OIDs = response['objectIds'] count = len(response['objectIds']) iteration = int(response['objectIds'][-1]) minOID = int(response['objectIds'][0]) - 1 OID = response['objectIdFieldName'] # Query service and check if editDate time is within the last hour if count < 1000: params = {'f': 'pjson', 'where': "1=1", 'outFields' : '*', 'returnGeometry' : 'false', 'token' : token} r = requests.post(URL, data=params, verify=False) response = json.loads(r.content) for feat in response['features']: pocemail2 = feat['attributes']['pocemail2'] category = feat['attributes']['category'] typeProb = feat['attributes']['probtype'] probDetails = feat['attributes']['details3'] createDate = feat['attributes'][dateField1] editDate = feat['attributes'][dateField2] status = feat['attributes']['status'] assignedto = feat['attributes']['assignedto'] personnel = feat['attributes']['Personnel'] if editDate is not None and editDate != createDate: editDate = int(str(editDate)[0:-3]) t = datetime.datetime.now() - timedelta(hours=hoursValue) t = time.mktime(t.timetuple()) if editDate > t: oidList.append(feat['attributes'][uniqueID]) else: y = minOID x = minOID + 1000 ids = response['objectIds'] newIteration = (math.ceil(iteration/1000.0) * 1000) while y < newIteration: if x > int(newIteration): x = newIteration where = OID + '>' + str(y) + ' AND ' + OID + '<=' + str(x) print('Querying features with ObjectIDs from ' + str(y) + ' to ' + str(x)) params = {'f': 'pjson', 'where': where, 'outFields' : '{0}, {1}'.format(uniqueID, dateField2), 'returnGeometry' : 'false', 'token' : token} r = requests.post(URL, data=params, verify=False) response = json.loads(r.content) for feat in response['features']: editDate = feat['attributes'][dateField2] editDate = int(str(editDate)[0:-3]) t = datetime.datetime.now() - timedelta(hours=hoursValue) t = time.mktime(t.timetuple()) if editDate > t: oidList.append(feat['attributes'][uniqueID]) x += 1000 y += 1000 print(oidList) s = editDate / 1000.0 s2 = createDate / 1000.0 # dFormat = "%d-%m-%Y %h:%m" d = datetime.datetime.fromtimestamp(s).strftime("%m-%d-%Y %H:%M %p") d2 = datetime.datetime.fromtimestamp(s2).strftime("%m-%d-%Y %H:%M %p") print(d) print(d2) # Email Info SUBJECT = 'Status Updated - Murphy Citizen Problem Reporter' html = """\ <html> <body> <p font-family: Arial>A "{0}" problem has been updated!</p> <p><b>Problem Overview:</b></p> <p>Status Update: {1}</p> <p>Assigned To: {2}</p> <p>Please allow 72 hours for a City of Murphy employee to contact you regarding this problem. You can also check the progress of your problem here:</p> <p><a href="https://murphytx.maps.arcgis.com/apps/CrowdsourceReporter/index.html?appid=6200a42374604a91b5a3956951518abe" target="_blank">Murphy Citizen Problem Reporter</a> </p> <p>Thank you,</p> </body> </html> <td style="color:DarkGreen; font-family: Arial, sans-serif; font-size: 14px;"> <b>City of Murphy</b><br /> <a href="mailto:gis@murphytx.org">gis@murphytx.org</a><br /> </td> """.format(typeProb, status, assignedto) # If new features exist, send email if len(oidList) > 0: smtpObj = smtplib.SMTP(host=smtpServer, port=portNumber) msg = MIMEText("alternative") msg = MIMEText(html, "html") msg['Subject'] = SUBJECT msg['From'] = fromEmail msg['To'] = pocemail2 smtpObj.sendmail(fromEmail, pocemail2, msg.as_string()) print("Successfully sent email") smtpObj.quit() results: Generating Token [] 03-30-2021 08:54 AM 03-30-2021 08:54 AM Process finished with exit code 0
... View more
03-30-2021
08:12 AM
|
0
|
0
|
6670
|
POST
|
Hi @UriGilad_EsriAu , here is the XLSForm. Thank you for taking a look!
... View more
03-26-2021
06:08 AM
|
0
|
0
|
1085
|
POST
|
Having trouble with hyperlinks not opening in a survey. The hyperlink is in the "Hint" section of a question. This is happening across different browsers for all users who have tested the survey for me. Current workaround is to have the user right click the hyperlink and open the document in a new tab/ window. The document is shared publicly and is 266KB. I downloaded the survey, opened the XLSForm and noticed this tags in the href: rel="noopener noreferrer". If I delete that tag in the href and re-publish, it gets added back in there automatically. Is this a bug, or am I doing something wrong? Thanks!!
... View more
03-24-2021
09:35 AM
|
0
|
3
|
1111
|
POST
|
@Anonymous User In the dev summit presentation will you go over how to register an app in AGO, and how to get the app's client ID and client secret? I'm trying to follow this post to set up my Integromat scenario for a hosted feature service but I'm new to all of this and need a bit more instruction. Thanks!
... View more
03-12-2021
09:37 AM
|
0
|
3
|
1764
|
POST
|
I'm following this blog post, particularly the latter portion of it - "Beyond the basics: Accessing attribute information". My integromat scenario is failing at the second "HTTP Make a request". The error that it gives is "Missing value of required parameter 'URL'"... but if I look at the Json Parse before that, it looks like the token is not being passed. The hosted feature layer that I am working with is not shared publicly, but the views that are being publicly edited are. Could this be the issue? The hosted feature layer and the views are apart of a Citizen Problem Reporter Application.
... View more
03-09-2021
07:00 AM
|
0
|
3
|
1329
|
Title | Kudos | Posted |
---|---|---|
1 | 02-09-2021 03:02 PM | |
1 | 05-25-2017 08:08 AM | |
2 | 01-13-2021 02:12 PM | |
1 | 07-06-2022 07:50 AM | |
1 | 06-02-2020 07:16 AM |
Online Status |
Offline
|
Date Last Visited |
06-20-2023
08:37 PM
|