POST
|
Thanks Johannes, so it's as I suspected. Unfortunately this is a corporate dataset and I can't change the attribute values which contain the html link already built, so I'll have to go figure out how to extract the URL and rebuild it manually with Arcade.
... View more
07-17-2023
10:08 AM
|
0
|
0
|
294
|
POST
|
I'm trying to create a custom popup but I'm having issues with one of my fields that contains a URL. I've tried adding the field to a text popup, but it returns the field value, but the link is broken. If I pull up the record in ArcGIS Pro and copy the value, I get: Reserve a site by visiting <strong><a href="https://www.recreation.gov/camping/campgrounds/234288">Recreation.gov</a></strong> or by calling Toll Free 1-877-444-6777 (International 518-885-3639 or TDD 877-833-6777). If I add the field to a text element of the popup it returns the text with a broken link, but the field in the fields list returns the link with a working link. I do not have the ability to edit this data, but I'm also open to using an arcade expression to extract just the URL and recreate this for the popup.
... View more
07-14-2023
05:14 PM
|
0
|
2
|
377
|
POST
|
Thanks again for the help Doug. I was able to get this working with some help from another coworker and wanted to share what I did in case anyone else has similar issues. Confirgure popups for the layer and go to Options > Attribute Expressions. I created a new expression with the code below. I then used the Add Content and added a text element to the popup and used the field for that expression to create the link. This didn't really change anything from what I had originally so not sure what exactly the problem was, but glad I got it working. // To launch survey123 from map
// EDIT THIS LINK TO MATCH YOUR SURVEY LINK (Only edit AFTER itemID= and BEFORE &
var urlsource ="arcgis-survey123://?itemID=###&"
//Format globalid to "link" survey point to map data -- MUST have globalid field for this script to work. DO NOT EDIT THIS LINE
var fglobalid = Mid($feature.GlobalID, 1,36)
//Generate other url parameters to pass to survey123. -- These are the values you wish to transfer from Field Maps to your Survey123 form.
// Edit or delete fields as necessary. The line containing $feature.GlobalID MUST NOT BE REMOVED, but the field to the left of $feature.GlobalID may
// be changed to reflect the field in your Survey to store the GlobalID.
var params = {
"field:incoming": $feature.GlobalID,
"field:Stand_Habitat_Type": $feature.Stand_Habitat_Type,
};
// Create callback portion of link using itemID (map ID) and featureSourceURL (services link to the layer containing the feature to be edited following survey submission)
// EDIT THIS LINK FOR LNF MAP AND LNF POINT FEATURE CLASS. updateFeature&itemID=<your maps ID>&featureSourceURL=<link to the feature class to be edited>
var callback = {
callback:"https://fieldmaps.arcgis.app/?referenceContext=updateFeature&itemID=###&featureSourceURL=https://services1.arcgis.com/###/arcgis/rest/services/AspenSurvey/FeatureServer/0",
}
// // Add featureID (must be var fglobalid) portion of callback link
// THIS LINE MUST NOT BE CHANGED. This line is what tells the script which point in the feature class will be edited
var callbackid = "featureID=" + fglobalid
var callbackattribute = 'featureAttributes={"ConditionSurvey":"Complete"}' // -- this would edit the ConditionSurvey field to reflect survey at the current point is complete
// Return the entire link/URL. This is what the FieldMaps app is following when you click the link to enter survey data. This should not be changed unless there is no callback
// attribute to pass back to Field Maps
return urlsource + UrlEncode(params) + "&" + UrlEncode(callback) + "%26" + UrlEncode(callbackid) + "%26" + UrlEncode(callbackattribute)
// For use in the pop-up for your featureclass, simply enter the expression name in the link field (i.e. {expression/expr0})
... View more
07-11-2023
11:30 AM
|
3
|
6
|
2015
|
POST
|
Thanks Doug, I have read that previous post of your and the replies several times and was where I got some of my arcade script from. Yeah, I'm pulling attributes from data in the map and the link has those replaced properly when I check in within map viewer. Though I just went to double check the link that is being created in Map Viewer and the FeatureID is properly populating with the features GlobalID, I did noticed the featureAttribute part is still showing up with the " in the URL (featureAttributes%3D%7B"ConditionSurvey"%3A"Yes"%7D) using the Arcade UrlEncode function so I tried manually encoding it then encoding it again and I'm able to rid of them but still not updating the feature as it appears should happen (featureAttributes%253D%257B%2522ConditionSurvey%2522%253A%2522Yes%2522%257D). Here is the full URL (double encoded on the featureAttribute part) I'm getting, though I've redacted ItemID's with ## as well as part of the Feature URL: arcgis-survey123://?itemID=##&field:Stand_Habitat_Type=Talus&field:incoming=82cf6bd4-a4d6-43d7-a955-9ed42e2f1ea4&callback=https%3A%2F%2Ffieldmaps.arcgis.app%2F%3FreferenceContext%3DupdateFeature%26itemID%3D##%26featureSourceURL%3Dhttps%3A%2F%2Fservices1.arcgis.com%2F##%2Farcgis%2Frest%2Fservices%2FAspenSurvey%2FFeatureServer%2F0%26featureID%3D82cf6bd4-a4d6-43d7-a955-9ed42e2f1ea4featureAttributes%3D%7B%22ConditionSurvey%22%3A%22Yes%22%7D
... View more
07-07-2023
01:51 PM
|
0
|
8
|
2043
|
POST
|
I'm trying to create a link to launch a survey123 survey with attributes passed from the selected feature in field maps and then use the callback to return to field maps and update an attribute on the feature that the survey was launched from. I've been reading ESRI's documentation at https://doc.arcgis.com/en/survey123/reference/integratewithotherapps.htm and https://doc.arcgis.com/en/field-maps/ios/help/deploy-your-map.htm along with posts here in the community but can't get the attributes to update with the callback and not sure what I'm missing. I'm using the Arcade content within the popup to add the link and I've attached my Arcade code below. It launches Survey123 and populates attributes in the Survey as I want and returns to field maps when the survey is submitted, but I can't get the attribute to update on the callback. featureSourceURL is the url to the hosted feature service and the layer within that service is layer 0. I'm thinking this might be part of the problem as if I past the url into the browser I get a token required page, but I've tried generating a token and adding the token to the url and that broke the callback. var S123 = "arcgis-survey123://?itemID=###"
var S123_Attributes = "&field:Stand_Habitat_Type={Stand_Habitat_Type}&field:incoming={GlobalID}"
var Callback = "&callback="
var CallbackFM = UrlEncode("https://fieldmaps.arcgis.app/?referenceContext=updateFeature")
var callbackID = UrlEncode("&itemID=###")
var callbackFeatureSource = UrlEncode("&featureSourceURL=https://services1.arcgis.com/###/arcgis/rest/services/AspenSurvey/FeatureServer/0")
var callbackFeatureID = UrlEncode("&featureID=")
var callbackFeatureGlobalID = UrlEncode($feature.GlobalID)
var callbackFeatureAttributes = UrlEncode('featureAttributes={"ConditionSurvey":"Yes"}')
var fullCallback = CallbackFM + callbackID + callbackFeatureSource + callbackFeatureID + callbackFeatureGlobalID + callbackFeatureAttributes
var fullURL = S123 + S123_Attributes + Callback + fullCallback
return {
type : 'text',
text : '<a href=' + fullURL + '>Open Survey with Callback</a>'
}
... View more
07-07-2023
09:54 AM
|
1
|
16
|
2421
|
POST
|
Nicolas, I was getting an almost identical error when trying to publish a hosted feature service this week. I spent several hours trying to figure out the problem, and the only thing I found that was causing the issue was that I had a domain on the service that had an apostrophe in the code value. If I tried published the service where the domain with this value I got the error. As it was a new field, I did testing where I removed the field and the service published, but when adding the field again it would cause the error. I then tried changing the code in the domain to what I have in the screen capture below and the service published.
... View more
06-17-2022
11:47 AM
|
0
|
1
|
897
|
POST
|
@HeatherGonzago I can't provide the app from my screen captures but I can publish a copy of the services and create an identical app to help identify the issue, just let me know what I need to do.
... View more
06-17-2022
10:53 AM
|
0
|
0
|
317
|
POST
|
I've noticed when editing in Map Viewer there is a delay from when you edit an attribute to when the attribute is actually changed if you select the same record to edit again. In the screen capture below I select a point and change the NEPA Status field. The label that is displaying that attribute is updated, but if you select the record again to edit, the edit feature pane still contains the old attribute (and its the same result on the fields with a domain or without). In Map Viewer, it probably isn't as big of a problem since the edit pane closes, but this becomes a much bigger issue in the web editor I built using experience builder. In experience builder, since the edit pane doesn't close after you click the update button, it could cause the user to think their edits did not get saved. These are hosted feature services and I did publish with Contingent Values. I am also using calculated expressions and custom arcade script for labels, but that doesn't seem like anything that should be causing this issue. I do also have an analysis join setup on this service which is created a hosted view, which I haven't used before but that also doesn't seem like it would cause this issue. Does anyone have any ideas on what is happening or how to fix this?
... View more
06-15-2022
10:58 AM
|
0
|
2
|
361
|
IDEA
|
Yes please, this is important functionality. From our Web Manager on why this important: What analytics tells us is who is accessing our products with what platforms, how they find it, and how long they stay and how much they interact with the products. While this isn’t directly tied to accessibility (it won’t tell us they are using a screen reader, for instance), it will give us a better idea on what our app designs should be first and foremost designed around.
... View more
06-06-2022
07:54 AM
|
0
|
0
|
1382
|
POST
|
What I want to do: When I click on a project boundary I want to return the Lynx Analysis Units (LAU) that intersect the project boundary. Then I want to take each of those intersecting LAU’s and calculate the acres of Lynx Habitat broken out by the Structural Stage (field = ‘StructuralStage’) within that entire LAU. Below is what I’ve started with and I’m close, just can’t figure out what I need to change. Currently I’m only getting the Structural Stage information for the first LAU. I would also like to clean up the number formatting to '#,###.#' and add “acres “. I'm assuming its how I'm compiling the information at the end, but I'm not sure what I need to change as I'm still learning how to use Arcade. var int_LAUs = Intersects($feature, FeatureSetByName($map,"LynxAnalysisUnits"));
var LynxHabitat = FeatureSetByName($map,"Lynx Habitat - Structural Stages");
var LAU = {}
var ss = {}
var xs = 0
var LH_area = 0
for (var i in int_LAUs){
var xs = AreaGeodetic(i, 'acres')
var int_lh = Intersects(i, LynxHabitat)
if(HasKey(LAU, i.DRAINAGE)){
LAU[i.DRAINAGE] += xs
}else{
LAU[i.DRAINAGE] = xs
}}
for (var h in int_lh){
var lh_area = AreaGeodetic(Intersection(i,h), 'acres')
if(HasKey(ss, h.StructuralStage)){
ss[h.StructuralStage] += lh_area
}else{
ss[h.StructuralStage] = lh_area
}
}
var out_str = "Lynx Structural Stage"
for (var d in LAU){
out_str += '\n' + d + ' LAU: ' + Text(LAU[d], '#,###.#' + ' acres') +'\n' + Text(ss, '#,###.#' + ' acres')
}
return out_str Screen capture of what my current arcade script is providing.
... View more
03-16-2021
01:34 PM
|
0
|
1
|
333
|
POST
|
Thanks Josh, that got me to what I needed, with just 1 change. I needed i.NAME in the HasKey part not just i. Without the i.NAME only seemed to work were I didn't have multiple polygons with the same management area within the project. My final code is below incase it helps anyone else. var managementareas = FeatureSetByName($map,"ManagmentAreas");
var int_ma = Intersects($feature, managementareas)
var int_dict = {}
var xs = 0
for (var i in int_ma){
var xs = AreaGeodetic(Intersection($feature, i), 'acres')
if(HasKey(int_dict,i.Name)){
int_dict[i.NAME] += xs
} else {
int_dict[i.NAME] = xs
}
var out_str = 'Management Area Acreage: ';
for (var d in int_dict){
out_str += '\n' + d + '\t|\t' + Text(int_dict[d], '#,###.#')
}}
return out_str
... View more
03-04-2021
10:57 AM
|
2
|
1
|
1686
|
POST
|
Thanks Josh, I've been trying to get the GroupBy to work and I think I'm close but there is still an issue with the calculated area. With the code below I'm getting for the popup. But the acres calculation is not accurate as its not adding up to the total acres in the project area. I pulled up the Shape_Area field and did an Arcade AreaGeodetic calculation on the project boundary to confirm, but can't figure out what the issue is. Our data is in a UTM projection which does explain the Shape_Area to Acres seen below, but if I use the square meters to acres conversion of 4,046.856 the calculation is still off. PVT should be about 30.7 acres Shape_Area / 43560 = Shape_Area / 4046.856 = var MA_intersect = Intersects(FeatureSetByName($map,"ManagmentAreas"), $feature);
var grp = {
name: 'total_area',
expression: 'round(Shape__Area / 43560, 1)',
statistic: 'SUM'
}
var group = GroupBy (MA_intersect, ['NAME'], grp)
var cnt = Count(group);
if (cnt > 0) {
var MAs = "";
for (var MA in group) {
MAs += MA.NAME + ": " + Text(MA.total_area, '#,###.#') + " Acres" + TextFormatting.NewLine;
}
return MAs;
} else {
return "No Overlaping Management Areas"
}
... View more
03-03-2021
04:09 PM
|
0
|
3
|
1697
|
POST
|
I am trying to add calculations for areas that intersect a project boundary, but have run into an issue with single part polygons returning an area for each intersecting polygon. I ran a test with a new layer with the polygons dissolved to multi part polygons and I get the results I want, but I need to be able to group the data from single part polygons as its not possible to edit some of the layers I need to run this on. I've included the Arcade code below that I've used, along with screen captures of the results on the single and multi part polygons. I did some searching and found the GroupBy function, but cant figure out how to set that up it will even do what I want. var MA_intersect = Intersects(FeatureSetByName($map,"ManagementAreas"), $feature);
var cnt = Count(MA_intersect);
if (cnt > 0) {
var MAs = "";
for (var MA in MA_intersect) {
var intersectArea = 0
intersectArea += Round(AreaGeodetic(Intersection($feature, MA), "acres"), 1);
MAs += TextFormatting.NewLine + MA.NAME + ": " + Text(intersectArea, '#,###.#') + " Acres" + TextFormatting.NewLine;
}
//result += TextFormatting.NewLine + MAs;
return MAs;
} else {
return "No Overlaping Management Areas"
} Results with multi part polygons: Results with single part polygons (I want this to look like the popup above):
... View more
02-26-2021
04:08 PM
|
0
|
5
|
1848
|
POST
|
I'm having issues with downloading 2 different maps for offline use. Both maps will open fine on both Android Samsung S2 and iPad. The issue seems to be the size of the area I try and download. On the Android tablets, if I select a small area to download, the map will download and open as expected but if I try and download a large area that the map will download but will not open and crashes Collector and Collector will continue to crash when trying to reopen. On the iPad, the small area with download and work as expected, but the larger area download will fail (Error Message: Map Download Failed Unable to download the map. The operation couldn't be completed. Unable to resume downloading the map. Unable to resume downloading the map.). I am also occasionally getting an error on the iPad of Layer Not Loaded Unable to load layer "layer name" from services1.arcgis.com The request timed out. I am using TPKs loaded on the device and not trying to download base maps. These 2 maps are were newly created back in May and were working at one point. Other maps do not have these issues. Collector is up to date on both Android and iPad (We have not switched to the new collector on iOS yet to try and maintain consistency between devices until the new version is released for Android) Devices: Android Galaxy Tab S2 Android Version 7 iPad Air 2 iOS 12.3.1
... View more
07-05-2019
10:36 AM
|
1
|
0
|
359
|
Title | Kudos | Posted |
---|---|---|
1 | 02-13-2024 07:18 AM | |
1 | 07-07-2023 09:54 AM | |
3 | 07-11-2023 11:30 AM | |
2 | 03-04-2021 10:57 AM | |
1 | 07-05-2019 10:36 AM |
Online Status |
Offline
|
Date Last Visited |
02-13-2024
03:28 PM
|