POST
|
Hi @DanielShaffer2 , I extracted the data and published it to my organization to do some testing and wanted to provide a small example of what you could do with Arcade. For instance, I can extract the last measurement of the water temperature from the Chemistry table by doing this: var station = $feature["Station_Name"];
var sql = "Location = @station";
var tbl = OrderBy(Filter(FeatureSetByName($datastore,"Chemistry_Import", ["Location", "Water_Temp_C", "Collection_Date"]), sql), "Collection_Date DESC");
var cnt = Count(tbl);
var result = Null;
if (cnt > 0) {
var temp = First(tbl)["Water_Temp_C"];
result = temp;
}
return result; Or I can extract the date on which the latest temperature was measured, like this: var station = $feature["Station_Name"];
var sql = "Location = @station";
var tbl = OrderBy(Filter(FeatureSetByName($datastore,"Chemistry_Import", ["Location", "Water_Temp_C", "Collection_Date"]), sql), "Collection_Date DESC");
var cnt = Count(tbl);
var result = Null;
if (cnt > 0) {
var dt = First(tbl)["Collection_Date"];
result = dt;
}
return result; Or the count of the Chemistry samples at each location: var station = $feature["Station_Name"];
var sql = "Location = @station";
var tbl = Filter(FeatureSetByName($datastore,"Chemistry_Import", ["Location"]), sql);
var cnt = Count(tbl);
return cnt; Or do some statistics of getting the average temperature at each location: var station = $feature["Station_Name"];
var sql = "Location = @station";
var tbl = Filter(FeatureSetByName($datastore,"Chemistry_Import", ["Location", "Water_Temp_C"]), sql);
var cnt = Count(tbl);
var result = Null;
if (cnt > 0) {
var temp = Mean(tbl, "Water_Temp_C");
result = temp;
} Having the (aggregated) data at the feature level allows you to use multiple attributes for visualization, like the latest temperature and the number of samples: ... or the mean temperature versus the latest temperature: This method is probably not the best when you have a lot of information that needs to be updated (a lot of field calculations to perform). In that case, it might be better to create a Notebook and use Python to update the data. This way you can also create a scheduled task that will execute every defined interval to update the data without any manual intervention.
... View more
04-19-2022
04:04 PM
|
0
|
3
|
2723
|
POST
|
Hi @DanielShaffer2 , To do some testing I will need to extract some of your data from the map, republish the data in my portal and look at the possible scenarios to accomplish this. It may take some time to do this, but I will have a look at it.
... View more
04-19-2022
05:43 AM
|
0
|
0
|
2728
|
POST
|
Hi @MarcoConopio1 , The error is pointing to the use of a field that does not exist in the featureclass. Can you check that the fields with names assigned to the variables "fld_orden" and "fld_label" exist in your featureclass?
... View more
04-19-2022
05:41 AM
|
0
|
0
|
597
|
BLOG
|
Hi @NicholasRutledge , As of the December 2021 update, there is a different way to create HTML content in the pop-up. There are some blogs on this topic by Paul Barker: https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/part-1-introducing-arcade-pop-up-content-elements/ https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/part-2-introducing-arcade-pop-up-content-elements/
... View more
04-18-2022
06:24 AM
|
0
|
0
|
1303
|
POST
|
Hi @AnneSanta_Maria1 , First of all thanks for sharing the sample data. This helped a lot to understand what you are after. Although I also answered your direct message, I wanted to share some thoughts on this challenge here available for the rest of the community too. When editing a point in ArcGIS Pro, the attribute rule defined on this point layer can have access to the values found in a different layer (like the rooms of a floor in a building). However, the way the attribute rule has access to the other layer is through the $datastore and the datastore is the source of the data and has no knowledge of what floor is currently visualized in a map. As I mentioned in my direct message, I believe the right way to go forward is to explore ArcGIS Indoors (https://www.esri.com/en-us/arcgis/products/arcgis-indoors/overview), since it comes with solutions to work with floors in a building and collect data for a specific location on a floor. An alternative solution in ArcGIS Pro, would be to approach this as a 3D problem. You can visualize your building in a local scene, define the base elevation (based on your elevation field), and if desired, the extrusion, based on the floor to floor height. Define a range slider based on the floor and visualize the floor where you want to create a 3D point. This will snap to the base elevation of the floor. You can use the Z value of the point to query the floor polygons and then use the Intersects function to intersect your point with the floor to obtain the room polygon. This allows you to use the information of the room directly for your point in an Attribute Rule. Below is the Attribute Rule I used: // get the building polygons
var building = FeatureSetByName($datastore, "Buildings_Room", ['BldRecNbr', 'Floor', 'RmRecNbr', 'RmNbr'], false);
// extract the z value of the 3D point and get a min and max value (z-1ft and z+1ft)
var z = Geometry($feature)["z"];
var zmin = z-1;
var zmax = z+1;
// create query on elevation using Z value of 3D point
var sql = "Elevation > @zmin AND Elevation < @zmax";
// filter building polygons to get floor polygons
var CurrentFloor = Filter(building, sql);
// do 2D intersection of feature with floor polygons
var intersectingrooms = Intersects(CurrentFloor, $feature);
// read out values
if (Count(intersectingrooms) > 0) {
var intersectingroom = First(intersectingrooms);
return{
"result" : {
"attributes": {
"BldRecNbr": Right(intersectingroom.BldRecNbr, 5),
"Floor": intersectingroom["Floor"],
"RmRecNbr": intersectingroom.RmRecNbr,
"RmNbr": intersectingroom.RmNbr
}
}
}
} ...and a visualization of the result:
... View more
04-12-2022
09:09 AM
|
0
|
0
|
1539
|
POST
|
Hi @CBarrett , Thanks for your support. You can find the link below: https://community.esri.com/t5/arcgis-online-internal-ideas/provide-the-location-clicked-in-the-pop-up-to-the/idi-p/1087588 (although this is an internal idea, and it might not be available to everyone)...
... View more
04-11-2022
01:35 PM
|
0
|
0
|
2921
|
POST
|
Hi @AnneSanta_Maria1 , That is an interesting case. I haven't played with that part but it somehow feels as if this should be possible. Would it be possible to get access to (a sample of) the data? Could you share this with me using my user "xbakker.spx"?
... View more
04-08-2022
02:18 PM
|
0
|
1
|
1555
|
DOC
|
Hi @KateRose , Thanks for sharing and sorry for the delay in my reply. this would have been my first thought. When IsEmpty does not detect a field as empty, it normally is a white space. Trim does a good job in removing those spaces. I am glad you and your colleague were able to solve it!
... View more
04-08-2022
02:13 PM
|
0
|
0
|
18417
|
POST
|
Hi @DanielShaffer2 , Sorry for getting back to you so late, but I was occupied organizing an event that took place yesterday. A couple of thoughts in case this is still current: Since you are using ArcGIS Online, I suppose that you want to symbolize the information there. This might limit the possibilities like using Attribute Rules which are available in ArcGIS Pro and ArcGIS Enterprise (but not in AGOL or ArcMap). You are right that it is complex and limited to visualize information from a related table. You can use Arcade in a Field Calculation (static) that accesses data from the related table and includes it as fields so that you can use multiple fields to visualize the results in the web map. However, if the data underneath changes in time, you will have to include a mechanism to update the values with a certain interval. Let me know if you still need help and if so, it would be nice to have access to some sample data to have a better understanding of what you want to achieve.
... View more
04-08-2022
02:09 PM
|
0
|
6
|
2739
|
DOC
|
Hi @KateRose , Sorry for the delay in my reply. A couple of comments that I believe are relevant. First of all, since December last year, you can define Arcade in two areas of the pop-up. The one that is most common works like a "virtual field" and can be used to create new information in the pop-up and, as described in this post, has been "abused" to hide information too. To hide 24 fields would require that you have many Arcade expressions and this would take up quite some time to configure. With the December update, it has become possible to define an Arcade element and add it to the pop-up. It is possible to return a field list in a single Arcade expression. See the example below: var flds = ['Actividad', 'actividad_con', 'califique_la_actividad', 'campa_a', 'clasificaci_n_de_actividad', 'descripci_n_evento_y_contenido_', 'describe_la_soluci_n_ofrecida', 'empresa', 'fecha_de_actividad'];
var info = [];
var atts = {};
for (var i in flds) {
var fldname = flds[i];
if (!IsEmpty($feature[fldname])) {
Push (info, {'fieldName': fldname})
atts[fldname] = $feature[fldname];
}
}
return {
type: 'fields',
title: 'My Title',
description : 'My description',
fieldInfos: info,
attributes : atts
} In this case, I start with a list of fields and I build an array with my field names (if you aren't empty) and a dictionary with the field values. The interpretation of the expression will present the result as a list of fields (but only those that have values). This will return the actual values and names of the field. So no conversion for domain descriptions of aliases for the fields. So you can have a little more fun and get all the fields that have values dynamically and return the alias as field "name" and the domain descriptions if a field has a domain: Function HasDomain(f, fldname) {
return Domain(f, fldname) != Null;
}
Function GetAlias(f, fldname) {
var esquema = Schema(f);
var flds = esquema["fields"];
for (var i in flds) {
var fldinfo = flds[i];
if (fldinfo["name"]==fldname) {
return fldinfo["alias"];
}
}
return fldname;
}
Function GetFieldNames(f) {
var fldlst = [];
var esquema = Schema(f);
var flds = esquema["fields"];
for (var i in flds) {
var fldinfo = flds[i];
Push(fldlst, fldinfo["name"]);
}
return fldlst;
}
var flds = GetFieldNames($feature);
var info = [];
var atts = {};
for (var i in flds) {
var fldname = flds[i];
if (!IsEmpty($feature[fldname])) {
var alias = GetAlias($feature, fldname);
Push (info, {'fieldName': alias})
if (HasDomain($feature, fldname)) {
atts[alias] = DomainName($feature, fldname);
} else {
atts[alias] = $feature[fldname];
}
}
}
return {
type: 'fields',
title: 'My Title',
description : 'My description',
fieldInfos: info,
attributes : atts
} But maybe you don't want to include all the fields in the result. In that case you can put those fields in a list and have the expression exclude those fields from the result, like this: Function HasDomain(f, fldname) {
return Domain(f, fldname) != Null;
}
Function GetAlias(f, fldname) {
var esquema = Schema(f);
var flds = esquema["fields"];
for (var i in flds) {
var fldinfo = flds[i];
if (fldinfo["name"]==fldname) {
return fldinfo["alias"];
}
}
return fldname;
}
Function GetFieldNames(f, excludeflds) {
var fldlst = [];
var esquema = Schema(f);
var flds = esquema["fields"];
for (var i in flds) {
var fldinfo = flds[i];
if (!Includes(excludeflds, fldinfo["name"])) {
Push(fldlst, fldinfo["name"]);
}
}
return fldlst;
}
var excludeflds = ['globalid', 'objectid'];
var flds = GetFieldNames($feature, excludeflds);
var info = [];
var atts = {};
for (var i in flds) {
var fldname = flds[i];
if (!IsEmpty($feature[fldname])) {
var alias = GetAlias($feature, fldname);
Push (info, {'fieldName': alias})
if (HasDomain($feature, fldname)) {
atts[alias] = DomainName($feature, fldname);
} else {
atts[alias] = $feature[fldname];
}
}
}
return {
type: 'fields',
title: 'My Title',
description : 'My description',
fieldInfos: info,
attributes : atts
}
... View more
03-18-2022
04:47 PM
|
0
|
0
|
18773
|
DOC
|
Hola Carlos, Que pena por la demora en mi respuesta. Interesante el caso que planteas. Primero que todo, es importante entender que llevar los datos CAD al UN sin corrección, resulta en algo visual pero no funcional. Es decir, no va ser posible crear subredes y por lo tanto no será posible realizar los traces, generar diagramas y aprovechar todos los beneficios que ofrece el UN. Contar con 2 versiones de la misma red es algo que no es recomendado. La buena práctica va muy enfocado a contar con un solo repositorio centralizada que representa "a single source of truth" (una sola verdad). Gestionar 2 versiones a la vez es doble trabajo. Tratar de montar 2 versiones en la misma UN no es posible, porque estarán usando el mismo dominio con los mismos featureclasses. Es posible convertir los datos CAD y gestionarlos en un Featuredataset distinta en la misma EGDB y establecer relationship classes entre ellos, pero realmente no veo el beneficio en hacer esto. Si los datos (la geometría) más exactos están representados en los datos CAD recomiendo hacer el esfuerzo de corregir la conectividad y usarlos para la migración al UN y combinarlos con los datos atributivos almacenado en GIS. Lo importante en este trayecto es establecer una visión de más largo plazo, ¿qué quiero lograr con la migración al UN?, ¿hasta dónde quiero llegar? La implementación de UN y ArcGIS realizada correctamente es un trayecto que puede (y debería) transformar el negocio, requiere re-imaginar los flujos de trabajo y roles que van a interactuar con el UN para sus flujos diarios de trabajo. Requiere también una gestión de cambio y no debe ser enfocado en replicar la situación actual sobre tecnología nuevo, es contar con una visión que permite tener un retorno máximo de la inversión. Lamento no brindar una solución sencilla al reto que estás planteando, pero es importante no empezar con la migración cuando los datos no se encuentren en un estado que permite tener éxito.
... View more
03-11-2022
06:08 AM
|
0
|
0
|
2120
|
DOC
|
Hola @CarlosSalguero_Hoffmann , En el momento de manejar múltiples dominios (ejemplo telco y energía) en un solo Utility Network, solamente vamos a contar con una red estructural. Esto nos permite gestionar un poste una sola vez, aunque sea utilizado por tanto la red de distribución eléctrica (por ejemplo para colgar un transformador) y por la red de telecomunicaciones (por ejemplo colgar una reserva de cables). En el Utility Network por el tema de conectividad de adjuntos el poste está conectado tanto al transformador como a la reserva de cables y de esta manera existe una relación. También el tema de reglas de atributos nos permite actualizar información en un dominio cuando hay un cambio en otro dominio (si existe un caso para justificar el cambio). ¿Es posible explicar un poco más que relaciones quiere establecer entre los dominios?
... View more
03-07-2022
01:37 PM
|
0
|
0
|
2148
|
POST
|
Hi @VanessaSimps , You can use the Text function to format the date the way you want. For an example see: https://community.esri.com/t5/arcgis-online-questions/arcade-date-function-for-expression-in-popup/td-p/79896 and the documentation can be found here: https://developers.arcgis.com/arcade/function-reference/text_functions/#text
... View more
03-07-2022
01:26 PM
|
0
|
0
|
1503
|
POST
|
Hi @DavidColey One way to go is to get the code a translate it to the description making use of the domain function. You can use something like the example below to get a dictionary of the domain and use that dictionary to translate the description based on the code. function GetDomainDct(lay, fldname) {
var dom = Domain(lay, fldname);
var cvs = dom["codedValues"];
var dct = {};
for (var i in cvs) {
var cv = cvs[i];
dct[cv["code"]] = cv["name"];
}
return dct;
}
... View more
03-07-2022
01:22 PM
|
0
|
2
|
856
|
POST
|
Hi @jcarlson , There is something additional you need to do in order to create a valid featureset containing dates. The date has to be translated to a UNIX timestamp. In the post below you can see an example: https://community.esri.com/t5/developers-questions/arcade-dictionary-to-featureset/td-p/1047117
... View more
02-25-2022
11:46 AM
|
0
|
0
|
901
|
Title | Kudos | Posted |
---|---|---|
1 | 11-12-2017 02:40 PM | |
1 | 11-14-2013 10:56 PM | |
1 | 05-22-2019 01:11 PM | |
1 | 06-28-2019 02:45 PM | |
2 | 07-27-2022 02:21 PM |
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|