POST
|
Brilliant! I figured it needed something SQL rather than Arcade in the GroupBy. This is just the trick I needed, thanks!
... View more
08-16-2022
05:51 AM
|
0
|
0
|
2350
|
POST
|
I am trying to come up with a data expression to count how many site visits occurred on each day (using created_date). The normal GroupBy function on the field groups it down to the minute, but I need the day. I've tried doing this but it has no effect. Any ideas? var daily_visits = GroupBy(fs, [{ name: 'date', expression: Text('created_date','Y-MM-DD')}], [{name: 'total', expression: '1', statistic: 'COUNT'}]) The end goal here is to create a serial chart with cumulative visit numbers over time. I do have a working expressions for that however with the number of records it loads very slowly so I'm trying to group them together before it cycles through and does its counting. Thanks
... View more
08-15-2022
02:27 PM
|
0
|
5
|
2403
|
POST
|
Is the attachments function in either Arcade pop-ups or dashboard data expressions not available in Enterprise 10.9.1? The documentation seems to suggest so but no matter what I do it just says "Not Available" next to the function. Thanks!
... View more
08-10-2022
11:34 AM
|
0
|
0
|
244
|
POST
|
Scratching my head trying to get a geoprocessing tool to work. If I run it in Pro or standalone in Pycharm it works fine, but when I publish and run it as a service it fails when trying to connect to the GIS. Locally, it works if I try either gis = GIS("home") or gis = GIS("https://........), but I get a "staging error" when I try to publish a tool using the latter method (the log just says error 999999). I tried doing a test with a 3 line tool and as soon as it gets to line 3 its fails import arcpy from arcgis import GIS gis = GIS('https://.....') Trying on a federated Enterprise 10.9.1 using IWA login. Guessing its not pulling credentials correctly based on the error below. We have a second portal which is not IWA and using GIS('home') works fine on it. Traceback (most recent call last): File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 610, in _handle_response data = resp.json() File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\requests\models.py", line 900, in json return complexjson.loads(self.text, **kwargs) File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\json\__init__.py", line 348, in loads return _default_decoder.decode(s) File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 1929, in _check_product baseurl + "/info", params={"f": "json"}, add_token=False File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 506, in get ignore_error_key=ignore_error_key, File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 613, in _handle_response raise Exception(resp.text) Exception: Server Error 401 - Unauthorized: Access is denied due to invalid credentials. You do not have permission to view this directory or page using the credentials that you supplied. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 3, in File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\__init__.py", line 483, in __init__ raise e File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\__init__.py", line 444, in __init__ proxy=kwargs.get("proxy", None), File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\_impl\_portalpy.py", line 180, in __init__ proxy=kwargs.get("proxy", None), File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 234, in __init__ self._product = self._check_product() File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 1932, in _check_product res = self.get(baseurl + "/info", params={"f": "json"}) File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 506, in get ignore_error_key=ignore_error_key, File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 625, in _handle_response self._handle_json_error(data["error"], errorcode) File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 648, in _handle_json_error raise Exception(errormessage) Exception: Your login session has been reset. Please try again. (Error Code: 404)
... View more
07-25-2022
08:29 AM
|
1
|
1
|
509
|
POST
|
I've been fighting with this problem as well and after a lot of trial and error I've found pulldata only works in a web form if dates are formatted YYYY-MM-DD in the CSV.
... View more
06-07-2022
10:21 AM
|
0
|
0
|
281
|
POST
|
Brand new to Javascript so I'm hoping I'm missing something simple here, but I have a very simple page cloned from the feature table with editing enabled sample code but swapped out my own feature layer. For the most part it works great but if I tell the table to sort on a column, it will select the correct feature but push updates to a different one. Here's where I select the record, I see the correct feature highlight. Changing the status field in the same record updates a different location. This only happens if I include direction: "asc" in one of the field configurations. Assuming there is a place for me to identify the objectid? Here's my page for reference. Thanks everyone <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" /> <title> FeatureTable widget with editing enabled | Sample | ArcGIS API for JavaScript 4.22 </title> <link rel="stylesheet" href="https://js.arcgis.com/4.22/esri/themes/light/main.css" /> <script src="https://js.arcgis.com/4.22/"></script> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } #viewDiv { height: 50%; width: 100%; } .container { height: 50%; width: 100%; } </style> <script> require([ "esri/Map", "esri/views/MapView", "esri/layers/FeatureLayer", "esri/widgets/FeatureTable", "esri/widgets/Editor" ], (Map, MapView, FeatureLayer, FeatureTable,Editor) => { let featureLayer; const features = []; const map = new Map({ basemap: "streets-navigation-vector" }); const view = new MapView({ container: "viewDiv", map: map, center: [-95.75,29.18], zoom: 7, popup: { autoOpenEnabled: false } //disable popups }); view.when(() => { featureLayer = new FeatureLayer({ // URL to the service url: "https://xxxxxxxxxxxxxxxxx/FeatureServer/0", outFields: ["*"], title: "Emergency Reporting Areas" }); map.add(featureLayer); // Create the feature table const featureTable = new FeatureTable({ view: view, layer: featureLayer, editingEnabled: true, menuConfig: { items: [ { label: "Zoom to feature(s)", iconClass: "esri-icon-zoom-in-magnifying-glass", clickFunction: (event) => { zoomToSelectedFeature(); } } ] }, // Autocast the FieldColumnConfigs fieldConfigs: [ { name: "name", label: "Area Name", editable: false, direction: "asc" }, { name: "type", label: "Type", editable: false, }, { name: "boilwater", label: "Boil Water Notice?" }, { name: "evacuation", label: "Evacuation Status" }, { name: "poweroutage", label: "Power Outage?" }, { name: "highwater", label: "High Water?" } ], container: document.getElementById("tableDiv") }); const polyInfos = { layer: featureLayer, label:"name", updateEnabled: false, formTemplate: { // autocasts to FormTemplate elements: [ { // autocasts to FieldElement type: "field", fieldName: "name", label: "Area" }, { type: "field", fieldName: "type", label: "Type" }, { type: "field", fieldName: "poweroutage", label: "Power Outage" }, { type: "field", fieldName: "boilwater", label: "Boil Water?" }, { type: "field", fieldName: "evacuation", label: "Evacuation Status" } ] } }; const editor = new Editor({ view: view, layerInfos: [polyInfos], // It is possible to set snapping via the API by directly setting SnappingOptions in the Editor. This can also be toggled on/off using the CTRL key. By default snapping is not enabled, setting enabled to true toggles this. snappingOptions: { // Autocastable to snapping options enabled: true, // sets the global snapping option that controls both geometry constraints (self-snapping) and feature snapping. featureSources: [ { // Autocastable to FeatureSnappingLayerSource // Enable feature snapping on specified layer(s) layer: featureLayer } ] } }); // Get the FeatureLayer's layerView and listen for the table's selection-change event featureTable.on("selection-change", (changes) => { // If the selection is removed, remove the feature from the array changes.removed.forEach((item) => { const data = features.find((data) => { return data.feature === item.feature; }); if (data) { features.splice(features.indexOf(data), 1); } }); // If the selection is added, push all added selections to array changes.added.forEach((item) => { const feature = item.feature; features.push({ feature: feature }); }); }); view.ui.add(editor, "top-right"); function zoomToSelectedFeature() { // Create a query off of the feature layer const query = featureLayer.createQuery(); // Iterate through the features and grab the feature's objectID const featureIds = features.map((result) => { return result.feature.getAttribute(featureLayer.objectIdField); }); // Set the query's objectId query.objectIds = featureIds; // Make sure to return the geometry to zoom to query.returnGeometry = true; // Call queryFeatures on the feature layer and zoom to the resulting features featureLayer.queryFeatures(query).then((results) => { view.goTo(results.features).catch((error) => { if (error.name !== "AbortError") { console.error(error); } }); }); } }); }); </script> </head> <body> <div id="viewDiv"></div> <div class="container"> <div id="tableDiv"></div> </div> </body> </html>
... View more
02-03-2022
12:38 PM
|
1
|
0
|
293
|
POST
|
Update: Solved the problem by populating the null placeholder fields with URL parameters. This will let them edit exiting data before passing it back through the Javascript function. Ducktaped and clunky, but at least it lets them get nice looking text on their dashboard.
... View more
01-31-2022
11:59 AM
|
0
|
0
|
583
|
POST
|
Short story, I have a dashboard with project statuses that is updated with a web form. The managers can update their project by clicking a hyperlink to open the form. Simple enough. The downside is since Survey123 puts "\n" for new lines if they hit enter, which does not show up on a dashboard. To get around this they manually type in "<br>" to create a new line. I'm looking for a way to automatically switch these out due to complaints. A quick Javascript snippet does the job for the most part (this also creates bullet points). function replacetext(p) { var newtext = p.replace(/ooo/g,'•').replace(/\n/g,'<br>'); return newtext;} However to avoid dependency cycle errors they would have to enter their status in a null placeholder field and the real field gets get the Javascript return value. This doesn't work when they are trying to edit preexisting data (which will always be the case). Is there a ways to pre-load the null editor fields, or even just a simpler way to do this that I'm missing? Thanks
... View more
01-31-2022
06:29 AM
|
0
|
1
|
641
|
POST
|
I'll try the visible column, thanks. The forms are more complex than I've let on but there are reasons it's set up the way it is.
... View more
11-16-2021
08:06 AM
|
0
|
0
|
361
|
POST
|
Is anyone aware of issues when opening a web form in editing mode of existing data, if a question is not relevant it still pushes back a null value? I have had several forms where this has been an issue. For instance, we have an a layer of features that assessments are conducted on. The form opens up to edit these features and fill out the assessment information. Normally one would enter a date and submit. However if a 'Reassessment' box is checked, that date is hidden and a reassessment date appears instead. I would expect when submitting on a reassessment it would just ignore this first date however the form appears to be submitting 'Null' and then zeroing out the existing data.
... View more
11-16-2021
07:48 AM
|
0
|
3
|
373
|
POST
|
It's good to know there are people struggling with this issue as well. I had this logged as BUG-000140140 earlier this year but recently received a message from support saying it was unreproducible. So far I haven't noticed a pattern to when it begins skipping. It'll go for several weeks and not miss a beat, then suddenly for another week it skips more than it runs. Most of the script is simple calculations within a Pandas dataframe, with a URL request and pushes to a feature layer. If I had to guess it is timing out on one of these connections. I'm going to implement the timeout as well as the logging method and see if I can contribute some findings here.
... View more
11-04-2021
06:22 AM
|
0
|
2
|
2271
|
POST
|
Have a Survey123 stood up for doing site assessments of debris. The worker loads a site from the inbox and adds a visit log as a repeated record. The existing visits have updates disabled and adds enabled. So far so good. The problem is when attempting to add a new record, it bumps back with an error that a photo is required. The field it points to is the photo from the previous visit that is already populated. Its updates are disabled I can't do anything about it. Easy solution for the moment is the make the photos not required but ideally they would be. Here's a screenshot of what happens to the existing read-only record when I try to add a new record.
... View more
09-24-2021
07:39 AM
|
0
|
3
|
518
|
POST
|
Would anyone have any updates on this? I just upgraded the Python API in Jupyter Notebooks to v1.9 and now its having the same issue so I will have to downgrade back to my old v1.6. Still no luck connecting in Pro now with 2.8.
... View more
08-18-2021
06:16 AM
|
0
|
0
|
865
|
POST
|
I have notebook running in our AGOL site every 15 minutes. The code is pretty simple, only takes about 10 seconds to run. However, there's been a few times in the last week since it started where it sits in 'executing' status for 4 to 6 hours so all the runs in that time are skipped. I'm thinking it might just being hanging while trying to connect to the AGOL. Is there a way to force the next iteration to run instead of skipping? Or shutdown the Notebook if it runs for more than ~2 minutes?
... View more
05-19-2021
04:44 AM
|
0
|
3
|
713
|
Title | Kudos | Posted |
---|---|---|
1 | 06-05-2023 03:23 PM | |
1 | 02-03-2022 12:38 PM | |
1 | 07-25-2022 08:29 AM | |
1 | 11-04-2021 05:58 AM | |
1 | 05-03-2021 07:54 AM |
Online Status |
Offline
|
Date Last Visited |
3 weeks ago
|