|
POST
|
Wow - talk about overthinking something. Thank you! I haven't explored input masks yet - this is super handy.
... View more
12-02-2021
07:59 AM
|
1
|
0
|
2529
|
|
POST
|
Hi - I am having a type mismatch issue with some time calculations. I have an existing survey XLSForm which is formatted like this...the calculation works perfectly. The number of minutes elapsed is returned. In this instance, the user is prompted to enter two times in this format - XX:XX and then the third line determines minutes elapsed. I want to modify the survey to do some behind the scenes calculations so that field staff do not need to enter the colon (:) between hours and minutes (we want the time to be entered like XXXX). I've modified the XLSForm to do this, and now my line 48, "Time_Elapsed" is throwing a type mismatch error. I can not figure out what I've done wrong as I feel like the results of line 43 (Interview_TimeColon) and line 47 (StartFishing_TimeColon) are not all that different from what was being input in the first 2 lines from the screen capture above (e.g. 10:45 vs. 1045, which is then calculated to 10:45). Things I have tried - changing 'type' column to calculate for all intermediate calculations (lines 41 to 43 & 45 to 47) changing bind::type column to 'time' for lines 43 and 47 (second screen capture) changing bind::esri:fieldType to 'null' for all intermediate calculations changing bind::esri:fieldType for line 48 from integer to string to no bind::esri:fieldType changing bind::esri:fieldType to 'date' for lines 43 and 47 Does anyone have any suggestions? I also did test using the solution from this post, but it did not work. Thank you,
... View more
11-30-2021
12:23 PM
|
1
|
2
|
2557
|
|
IDEA
|
If this idea ever got implemented, I think it would save many people lots of time in re-configuring web maps, apps or Dashboards that contain "joined view layers" if a hosted feature layer schema needs to be updated.
... View more
11-26-2021
06:34 AM
|
0
|
0
|
5678
|
|
POST
|
Hi @jcarlson - I looked at sum, min, max and those are also inconsistent. Here is how I am getting these inconsistent values... 1. First, I updated my data expression from that last post on Wednesday to remove the Floor - this was good because I was eliminating many 0.5 values which should not happen. That data expression powers the "Private Launches per DOW" and "Rental Launches per DOW" charts which you can see at the Dashboard I have linked to below (these charts show all data, but can be filtered using the 'Select Boat Launch Area' option at top). 2. Filter the chart that results from that data expression by day of week and take all values presented and enter into Excel. Calculate average, sum, max, min. 3. Open serial chart config for the "average private launches per DOW" and change statistic to compare results for specific BLA and DOW to see how they compare. Here is one example: For Saturday BLA1 - AVG - 42 (Excel) vs. 27 (serial chart) SUM - 1,145 (Excel) vs. 654 (serial chart) MAX - 88 (Excel) vs. 64 (serial chart) MIN - 4 (Excel) vs. 2 (serial chart) You can see a public version of my current Dashboard here - https://mass-eoeea.maps.arcgis.com/apps/dashboards/0773a2c3a27b4690b8632b082e33690c I am mystified by these differences. Also, I would expect that Saturday & Sunday would have a much higher average use per DOW as these are the two most popular boating days. I would be interested in your thoughts on this. Thank you,
... View more
11-26-2021
06:22 AM
|
0
|
1
|
4159
|
|
IDEA
|
Trendlines would be a great addition to Dashboard serial charts.
... View more
11-24-2021
10:00 AM
|
0
|
0
|
1178
|
|
POST
|
Hi @jcarlson This is awesome! It worked perfectly. I do have a follow-up question however relating to what you mentioned above about time stamps. Here is another data expression - this is the one that gives me a count of boat usage by day of week for the season. I am wondering if the fact that I did not strip away the time stamps here will result in an incorrect output. I'd be interested in your thoughts. This uses the same data as above. The reason I ask...I took the graph which is generated by the script below and filtered for just "BLA1". I took all of the values provided for one day of the week (Saturday) and used the average function in Excel to see if the average was the same as what was provided by the graph I created using the script above - it was not (27.3 vs ~18 in Excel). Theoretically, I could add up all of the Saturday counts for BLA1, average them in Excel and get the same value as what the above script provides. var portal = Portal("https://www.arcgis.com");
// Group the features by the BLA
var BLA = FeatureSetByPortalItem(portal,"faadbf5e0ef44523a8eb0d37adab33aa",0,['BLA_Used', 'Survey_Date'],false);
var groupBLA = GroupBy(BLA,
["Survey_Date"],
[
{ name: "BoatLaunchArea", expression: "BLA_Used", statistic: "MIN" },
{ name: "cntBoats", expression: "BLA_Used", statistic: "COUNT" },
{ name: "date", expression: "Survey_Date", statistic: "MIN" },
]
);
var combinedDict = {
fields: [
{ name: "sdate", type: "esriFieldTypeDate" },
{ name: "dow", type: "esriFieldTypeInteger" },
{ name: "BLA", type: "esriFieldTypeString" },
{ name: "cntSurveyScans", type: "esriFieldTypeInteger" },
],
geometryType: "",
features: [],
};
var i = 0;
for (var m in groupBLA) {
combinedDict.features[i] = {
attributes: {
BLA: m["BoatLaunchArea"],
cntSurveyScans: (Floor(m["cntBoats"] / 2)),
sdate: DateDiff(m["Survey_Date"], Date(1970, 0, 1), "MM/DD/yyyy"),
dow: Weekday(m["Survey_Date"]),
},
};
i++;
}
return FeatureSet(Text(combinedDict)); The chart is configured like this: Thank you for your help!
... View more
11-24-2021
08:55 AM
|
0
|
3
|
4190
|
|
POST
|
Hi @jcarlson - Thank you. So something in the code you suggest is not working properly for me once I get to the actual graphing portion. I was having this issue last week in my testing with trying to get this data expression to work: You can see the value (y) axis is not correct - I end up with decimal values of 0.1 for everything. I do not really understand why this is happening. Also, to answer your question about the "sdate" field in my original script - this came from a separate data expression that I wrote so I could graph the count of boats per day of week through the entire boating season (April - October) so that we could have a sense of overall use trends throughout the boating season. I figured I'd use that as a basis for this "average use by weekday" data expression you are helping me with now. The "sdate" field allowed me to include the date in the featureSet, and then I used that to calculate Weekday for each row in my featureSet. The graph output of the other data expression (where "sdate" originated) is: If you have the time or inclination...here is a View of the data I am working with if you are able to test this with the real data...https://mass-eoeea.maps.arcgis.com/home/item.html?id=faadbf5e0ef44523a8eb0d37adab33aa#overview Thank you,
... View more
11-24-2021
05:45 AM
|
0
|
5
|
4200
|
|
POST
|
Hi, I have a Data Expression that I am using in my Dashboard to help me create a graph that shows average use by day of week for three separate locations. I am unsure if this is actually providing me with the correct values, and was hoping someone can look this over to see if what I am doing makes sense / is actually right. Any help refining this would also be really helpful, as I'm sure this is not elegant. var portal = Portal("https://www.arcgis.com");
// Group the features by the BLA
var BLA = Filter(FeatureSetByPortalItem(portal,"xxx",0,['BLA_Used', 'Survey_Date', 'Name'],false), "NOT Name = 'Rental%'");
var groupBLA = GroupBy(BLA,
["Survey_Date"],
[
{ name: "BoatLaunchArea", expression: "BLA_Used", statistic: "MIN" },
{ name: "cntBoats", expression: "BLA_Used", statistic: "COUNT" },
{ name: "date", expression: "Survey_Date", statistic: "MIN" },
]
);
var combinedDict1 = {
fields: [
{ name: "sdate", type: "esriFieldTypeDate" },
{ name: "dow", type: "esriFieldTypeInteger" },
{ name: "BLA", type: "esriFieldTypeString" },
{ name: "cntSurveyScans", type: "esriFieldTypeInteger" },
],
geometryType: "",
features: [],
};
var i = 0;
for (var m in groupBLA) {
combinedDict1.features[i] = {
attributes: {
BLA: m["BoatLaunchArea"],
cntSurveyScans: (Floor(m["cntBoats"] / 2)),
sdate: DateDiff(m["Survey_Date"], Date(1970, 0, 1), "MM/DD/yyyy"),
dow: Weekday(m["Survey_Date"]),
},
};
i++;
}
var dict1 = FeatureSet(Text(combinedDict1));
var groupDOW = GroupBy(dict1,
[
{ name: "dow", expression: "dow" },
{ name: "BLA", expression: "BLA" }
],
[
// { name: "BLAName", expression: "BLA", statistic: "MIN" },
// { name: "surveydate", expression: "sdate", statistic: "MIN" },
{ name: "countBoats", expression: "BLA", statistic: "COUNT" },
]
);
var combinedDict2 = {
fields: [
{ name: "BoatArea", type: "esriFieldTypeString" },
{ name: "wday", type: "esriFieldTypeInteger" },
{ name: "avgBoats", type: "esriFieldTypeInteger" },
],
geometryType: "",
features: [],
};
var x = 0;
for (var n in groupDOW) {
combinedDict2.features[x] = {
attributes: {
BoatArea: n["BLA"],
wday: n["dow"],
avgBoats: (Floor(Average(n["countBoats"] / 2))),
},
};
x++;
}
return FeatureSet(Text(combinedDict2)); One additional note...towards the bottom for 'avgBoats', I have divided by 2 in addition to using 'Average' because each boat is scanned twice - once when launching and once when coming off water. I wanted to divide by 2 so each boat is only counted once, and then Average what was left. Here is a sample of the output: Any help would be appreciated!
... View more
11-23-2021
12:46 PM
|
0
|
7
|
4278
|
|
POST
|
Hi - Cross-posting from ArcGIS REST API question board...see original version here. I am using this blog from @AaronPulver to create webhooks in Power Automate for a Field Maps workflow. Currently, I am attempting to set up a webhook that generate an email when a new record is added to a related table - this portion works perfectly. What I really want to do is also return the attributes from the point feature it is related to so that I can include one of the attributes in my email notification. Looking at the Extract Changes documentation, I see that I should be able to include "includeRelated=true" to return the related record, however I am unsure of where to add this query in. I have attempted to include this at a variety of locations without luck. Currently I have included this within the "Check Status" HTTP request...the Flow runs, but attributes from the related record are not returned. I have also attempted to include this under "Get Edits" and "Get Edits Redirect" also with no luck. Any suggestions would be appreciated! Erica
... View more
11-22-2021
10:45 AM
|
0
|
1
|
1510
|
|
POST
|
Hi - I am using this blog from @Anonymous User to create webhooks in Power Automate. Currently, I am attempting to set up a webhook that generate an email when a new record is added to a related table - this portion works perfectly. What I really want to do is also return the attributes from the point feature it is related to so that I can include one of the attributes in my email notification. Looking at the Extract Changes documentation, I see that I should be able to include "includeRelated=true" to return the related record, however I am unsure of where to add this query in. I have attempted to include this at a variety of locations without luck. Currently I have included this within the "Check Status" HTTP request...the Flow runs, but attributes from the related record are not returned. I have also attempted to include this under "Get Edits" and "Get Edits Redirect" also with no luck. Any suggestions would be appreciated!
... View more
11-22-2021
08:08 AM
|
1
|
1
|
1629
|
|
BLOG
|
I just tested and this worked perfectly. Thank you for your help, and the fantastic blog.
... View more
11-19-2021
09:03 AM
|
0
|
0
|
2911
|
|
BLOG
|
@Anonymous User This is great - thank you again. Last question. If I want to re-format the email using HTML, how do I format the attribute field names to call them into the email body? With Survey123 I use the syntax triggerBody()?['feature']?['attributes']?['field name'] - is it the same here, or is there documentation that can help me figure out what I should be using? Thank you!
... View more
11-19-2021
07:55 AM
|
0
|
0
|
2920
|
|
BLOG
|
@Anonymous User - thank you, this worked perfectly. If I want to also use this workflow to generate notifications when data are edited, can I find the proper syntax to update in the Extract Changes API documentation? It looks like I should be able to... I am guessing I'd need to make changes within the JSON to do this, in addition to changing the "Change Types" parameter within the Webhook settings at the REST endpoint. Thank you!
... View more
11-19-2021
07:30 AM
|
0
|
0
|
2932
|
|
POST
|
Hi @JamesTedrick - I am having a similar issue...although with time instead of date. I have an existing survey XLSForm which is formatted like this...the calculation works perfectly. The number of minutes elapsed is returned. I want to modify the survey to do some behind the scenes calculations so that field staff do not need to enter the colon (:) between hours and minutes. I've modified the XLSForm to this, and now my line 48, "Time_Elapsed" is throwing a type mismatch error. I can not figure out what I've done wrong as I feel like the results of line 43 (Interview_TimeColon) and line 47 (StartFishing_TimeColon) are not all that different from what was being input in lines 40 and 44 (e.g. 10:45 vs. 1045, which is then calculated to 10:45). Do you have any suggestions? I did test what you show in the example XLS above, however it did not work - I continue to get a mismatch error. Thank you,
... View more
11-15-2021
12:20 PM
|
0
|
1
|
4329
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 1 | 3 weeks ago | |
| 1 | 09-06-2022 09:14 AM | |
| 6 | 10-24-2024 12:04 PM | |
| 1 | 04-28-2021 09:14 AM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|