|
POST
|
Hi @erica_poisson , In the returned json I notice that the geometry also contains the spatial reference for each feature. I am not sure if this may be causing any conflict. "spatialReference": {
"latestWkid": 3857,
"wkid": 102100
} We can change the expression and exclude that part and see what happens. I must admit that in the past I have had situations where a correctly formed JSON is created and an empty feature set is returned. Not sure if we are running into a restriction here. One thing we can try is this: // settings
var p = 'https://www.arcgis.com';
var itemID_CMpts = 'xxx';
var layerID_CMpts = 0;
var relationshipName = "";
// access first featureset
var fs1 = Filter(FeatureSetByPortalItem(Portal(p), itemID_CMpts, layerID_CMpts, ['Point_Status', 'EQ_File_Number', 'Inspection_Date'], true), "Point_Status ='Unstable' AND EQ_File_Number In ('EQ2015-078', 'Eq2013-026', 'EQ2018-082', 'EQ2018-052', 'EQ2001-080X', 'EQ2003-021', 'EQ1989-015', 'EQ2002-023', 'EQ2002-045X', 'EQ2019-110', 'EQ2020-017', 'EQ2019-091', 'EQ2018-029', 'EQ2020-033', 'EQ2019-036', 'EQ2020-052', 'EQ2019-064', 'EQ2017-040', 'EQ2020-031', 'EQ2021-003', 'EQ2011-016', 'EQ2017-026', 'EQ2021-020')");
// create data schema
var Dict = {
'fields': [
{'name': 'EQNum', 'type': 'esriFieldTypeString'},
{'name': 'InspecDate', 'type': 'esriFieldTypeDate'},
{'name': 'PtStatus', 'type': 'esriFieldTypeString'}],
'geometryType': 'esriGeometryPoint',
'features':[]};
// analysis and fill Dict
var i = 0;
for (var f in fs1) {
var fs2 = FeatureSetByRelationshipName(f, relationshipName, ['Point_Status_revisit'], false);
var cnt = Count(fs2);
if (cnt == 0) {
Dict.features[i] = {
'geometry': {
'x': Geometry(f)["X"],
'y': Geometry(f)["Y"]
},
'attributes': {
'EQNum': f["EQ_File_Number"],
'InspecDate': f["Inspection_Date"],
'PtStatus': f["Point_Status"]
}
};
i++;
}
}
Console(Text(Dict));
return FeatureSet(Text(Dict)); Please share back what is returned in the console.
... View more
05-07-2021
09:29 AM
|
0
|
1
|
3395
|
|
POST
|
Hi @erica_poisson , The structure is a bit different. The schema is created once before the loop and you need to insert the results in the feature. When you need to include the geometry this is something you also need to include in the dictionary. I have not worked with returning geometries in data expression, but if I consult the syntax of the json it should be something like this: // settings
var p = 'https://www.arcgis.com';
var itemID_CMpts = 'xxx';
var layerID_CMpts = 0;
var relationshipName = "";
// access first featureset
var fs1 = Filter(FeatureSetByPortalItem(Portal(p), itemID_CMpts, layerID_CMpts, ['Point_Status', 'EQ_File_Number', 'Inspection_Date'], true), "Point_Status ='Unstable' AND EQ_File_Number In ('EQ2015-078', 'Eq2013-026', 'EQ2018-082', 'EQ2018-052', 'EQ2001-080X', 'EQ2003-021', 'EQ1989-015', 'EQ2002-023', 'EQ2002-045X', 'EQ2019-110', 'EQ2020-017', 'EQ2019-091', 'EQ2018-029', 'EQ2020-033', 'EQ2019-036', 'EQ2020-052', 'EQ2019-064', 'EQ2017-040', 'EQ2020-031', 'EQ2021-003', 'EQ2011-016', 'EQ2017-026', 'EQ2021-020')");
// create data schema
var Dict = {
'fields': [
{'name': 'EQNum', 'type': 'esriFieldTypeString'},
{'name': 'InspecDate', 'type': 'esriFieldTypeDate'},
{'name': 'PtStatus', 'type': 'esriFieldTypeString'}],
'geometryType': 'esriGeometryPoint',
'features':[]};
// analysis and fill Dict
var i = 0;
for (var f in fs1) {
var fs2 = FeatureSetByRelationshipName(f, relationshipName, ['Point_Status_revisit'], false);
var cnt = Count(fs2);
if (cnt == 0) {
Dict.features[i] = {
'geometry': Geometry(f),
'attributes': {
'EQNum': f["EQ_File_Number"],
'InspecDate': f["Inspection_Date"],
'PtStatus': f["Point_Status"]
}
};
i++;
}
}
return FeatureSet(Text(Dict));
... View more
05-07-2021
07:46 AM
|
0
|
3
|
3398
|
|
POST
|
Hola @Juan_CarlosCarpio , El tiempo que se ve en la FGDB está expresada en UTC. La razón es que en un proyecto pueden editar personas que se encuentren en diferentes zonas de tiempo. Para tener un registro correcto, el tiempo se almacene en UTC y por lo tanto estás viendo este diferencia de +5:00 horas. En ArcGIS Online se toma el tiempo UTC se visualice en hora local. Es posible en ArcGIS Pro calcular la hora local con Arcade usando la formula: ToLocal($feature["hora_inicio"]) También puedes usar la herramienta Convert Time Zone que está disponible en ArcMap y ArcGIS Pro: https://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/convert-timezone.htm (aunque no da mucha información acerca los parametros que debes usar en este caso) También te recomiendo leer: https://desktop.arcgis.com/en/arcmap/latest/map/time/why-set-a-temporal-reference.htm
... View more
05-07-2021
06:43 AM
|
1
|
0
|
4195
|
|
POST
|
Hola @Juan_CarlosCarpio , Es posible bajar los adjuntos de un servicio alojado en ArcGIS Online. En este artículo puedes encontrar como hacerlo: https://support.esri.com/es/technical-article/000012232 También es posible bajar los datos de la encuesta con los adjuntos en un FGDB. El proceso encuentres a continuación: En tu contenido en ArcGIS Online ubique la carpeta con la encuesta: Abre la página con el detalle del Featurelayer (alojada). En la pestaña "Información General" encuentres en la parte de la derecha la opción "Exportar datos" y luego "Exportar a FGDB": Luego debes especificar algunos datos para el FGDB que se va a generar y eliges la opción "Exportar": En la página del elemento FGDB encuenstres la opción "Descargar": No olvides eliminar el FGDB después de cargar para evitar el consumo de créditos. En la pestaña avanzada de la página del elemento FGDB vas a encontrar la opción para eliminar la FGDB después de haberlo descargado:
... View more
05-05-2021
03:07 PM
|
1
|
0
|
4215
|
|
POST
|
Hi @Carl_Flint , That definitely sounds like something that shouldn't occur. Since the map Viewer is out of beta, you can contact support with this issue. Last month a blog post was released to explain the coexistence of the two map viewers and shows what functionality is exclusive for each map viewer: https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/tale-of-two-arcgis-online-map-viewers-functionality-guidance/ As a side note, the Map Viewer also has a link to the roadmap (left panel, the information button) which should link to https://community.esri.com/t5/arcgis-online-documents/map-viewer-roadmap/ta-p/920839
... View more
05-05-2021
02:22 PM
|
0
|
0
|
1687
|
|
POST
|
Hi @erica_poisson , The Esri Training catalog and learn paths are good ways to start. The developer help can be useful to understand each function (although sometimes it might be a bit confusing). Paul Barker has written some very good blogs on Arcade, Hussein Nasser more on Arcade in Attribute Rules and David Nyenhuis on Arcade in Dashboards: https://www.esri.com/arcgis-blog/?s=#arcade Basic knowledge of JavaScript might be an advantage, although Arcade is just a subset of JavaScript with some specific functions added. I have published some blogs/documents here in the Esri Community, but some of them are Spanish: https://community.esri.com/t5/forums/searchpage/tab/message?filter=authorId,includeTkbs&q=arcade&include_tkbs=true&author_id=1108&collapse_discussion=true What you did by reaching out to the Esri Community is a very good way of getting help when starting with Arcade or resolving complex challenges further along the road. There are many users that are willing to help others and that makes this community so great.
... View more
05-05-2021
08:25 AM
|
1
|
0
|
3409
|
|
POST
|
Hi @erica_poisson , That is a good question. I have seen some limitations with actions configured between widgets in the dashboard (not maps) when using data expressions. It seems that if two widgets use a different data expression, they cannot be linked (even if the resulting featureset have a common key). I can understand the logic behind this, but it is kinda limiting when it shouldn't. I don't think map actions will work because your featureset based on an Arcade data expression will not have the same schema as the data in the map (or perhaps does not have geometries to be filtered by extent). Use layer actions, it might work since you can specify the input and output fields that should match. However, it is most likely that it will not work as you are experiencing. If the action should be related to those records that do not have attachments, the creation of the data expression featureset should include the individual geometries in order to filter those using the extent. This would be more work but might be possible (not sure though).
... View more
05-05-2021
08:13 AM
|
0
|
2
|
3411
|
|
POST
|
Hi @Morin , What you are seeing is when you write the Now() or Timestamp() to the console, right? If you return the date value you will probably see a date and no indication for the time zone. When you create a date it will be created in the local time (in your time zone). The +2:00 you are seeing indicates the time zone, which in my case is -5:00 (Colombia). When you create the current time with Now() it will give you the local date time and with Timestamp() it will give you the current UTC date time. Have a look at a couple of examples below: Now(): 2021-05-05T09:39:28-05:00
ToUTC(Now()): 2021-05-05T14:39:28-05:00
ToLocal(Now()): 2021-05-05T04:39:28-05:00
ToLocal(ToUTC(Now())): 2021-05-05T09:39:28-05:00 The first, second and fourth lines are correct. The 3rd line does not make sense. I am using ToLocal to convert a UTC date time to my local time zone, but I provide a local time. Same goes for Timestamp; the first, third and fourth are correct. The second does not make sense since I use a UTC date time and use ToUTC to convert it to UTC. The function assumes that the date time is provided in local time, but it is not the case. Timestamp(): 2021-05-05T14:39:28-05:00
ToUTC(Timestamp()): 2021-05-05T19:39:28-05:00
ToLocal(Timestamp()): 2021-05-05T09:39:28-05:00
ToUTC(ToLocal(Timestamp())): 2021-05-05T14:39:28-05:00 When working with date time, it is important to know in what time zone there are expressed to be able to handle them correctly. I do agree that this can be very confusing and prone to errors.
... View more
05-05-2021
07:53 AM
|
1
|
0
|
4234
|
|
POST
|
Hi @erica_poisson , That is interesting. It returns the correct value, but it does show an error. Maybe the name for the relationshipclass that should be used has to be "Construction_Monitoring_Revisit" (I am not sure). The best way to validate this is to add the layer to the map and use the navigation in the interface when creating an expression as described earlier. Just to be sure that you are using the correct name. I am also wondering if it is enough to return the count as a number or that a featureset is expected. I think the latter. In that case, you could use something like the expression below. var p = 'https://www.arcgis.com';
var itemID_CMpts = 'xxx';
var layerID_CMpts = 0;
var relationshipName = "Construction_Monitoring_Revisit";
var fs1 = Filter(FeatureSetByPortalItem(Portal(p), itemID_CMpts, layerID_CMpts, ['Point_Status', 'EQ_File_Number'], false), "Point_Status ='Unstable' AND EQ_File_Number In ('EQ2015-078', 'Eq2013-026', 'EQ2018-082', 'EQ2018-052', 'EQ2001-080X', 'EQ2003-021', 'EQ1989-015', 'EQ2002-023', 'EQ2002-045X', 'EQ2019-110', 'EQ2020-017', 'EQ2019-091', 'EQ2018-029', 'EQ2020-033', 'EQ2019-036', 'EQ2020-052', 'EQ2019-064', 'EQ2017-040', 'EQ2020-031', 'EQ2021-003', 'EQ2011-016', 'EQ2017-026', 'EQ2021-020')");
var tot = 0;
for (var f in fs1) {
var fs2 = FeatureSetByRelationshipName(f, relationshipName, ['Point_Status_revisit'], false);
var cnt = Count(fs2);
if (cnt == 0) {
tot += 1;
}
}
// return tot;
// create data schema
var Dict = {
'fields': [
{'name': 'CountNoAttach', 'type': 'esriFieldTypeInteger'}],
'geometryType': '',
'features': []};
// fill the data schema with the data
Dict.features[0] = {
'attributes': {
'CountNoAttach': tot
}}
// return the featureset
return FeatureSet(Text(Dict));
... View more
05-05-2021
07:21 AM
|
1
|
6
|
10781
|
|
POST
|
Hi @Amanda__Huber , As far as I know, that is not possible using Arcade. If you would have Enterprise (or ArcGIS Pro) you could use Arcade in attribute rules to automatically maintain another point layer where the center points would be stored. In the map, you would have to add the point layer and define visibility based on the scale. For ArcGIS Online, I would probably use ArcGIS Pro and the Feature to Point tool to create the layer or use the Find Locations | Find Centroids (consumes credits) in ArcGIS Online to create the point layer.
... View more
05-04-2021
02:01 PM
|
0
|
0
|
4378
|
|
POST
|
Hi @erica_poisson , Good question... Normally, when you edit an Arcade expression you will have access to the properties and the easiest way is navigating the interface to use the relationship. Let me visualize this. In the expression editor you would find the $feature on the right and you can enter and find all the fields of this $feature (click on ">" in blue rectangle): Next, at the end of the list of attributes you would find "Related records" and you can see all the relationships (click on ">" in blue rectangle) This will show the relationship and when you click on the "FeatureSetByRelationshipName" link it will be correctly inserted in the code. However, since you access the data in the data expression using the "FeatureSetByPortalItem" you will not find those options in the interface. You can go to the details page of the hosted feature layer and open the REST end point: In the REST endpoint page at the end, you will find the relationships section with the name of the relationship:
... View more
05-04-2021
12:46 PM
|
0
|
8
|
10786
|
|
POST
|
Hi @Amanda__Huber , So in the symbology profile, Arcade could return a geometry, but this is not something that is valid and that can be used to draw those features. Can you elaborate a bit more on what you have and what you want to get (and explain the why in this a bit more)?
... View more
05-04-2021
11:35 AM
|
0
|
2
|
4392
|
|
POST
|
Hi, Sorry for the first suggestion and that wasn't a good one. Since you mentioned Field Maps, I am sure you have come across the Field Maps web app where you can configure what you need and more. Just go to the Form tab and for each field you can define if this is editable by the field worker. You can also drag and drop the field to reorder them.
... View more
05-04-2021
10:58 AM
|
0
|
0
|
1738
|
|
POST
|
Hi @_____ , Perhaps the easiest way to do this is to use a hosted feature layer view and defined which field can be edited.
... View more
05-04-2021
10:00 AM
|
0
|
2
|
1749
|
|
POST
|
Hi @erica_poisson , I just had a look in the list of functions available when creating an Arcade data expression. For instance, the Attachments function is not available, but FeatureSetByRelationshipName is. I assume you published your data and related data with a relationship class. If this is not the case, you can still use the filter function to get the same result. The performance will depend greatly on the number of features you have since a loop through all features is required to get this result. Based on the sample expression you shared, have a look at the expression below: var p = 'https://www.arcgis.com';
var itemID_CMpts = 'xxx';
var layerID_CMpts = 0;
var relationshipName = "the name of the relationship between data and related data";
var fs1 = FeatureSetByPortalItem(Portal(p), itemID_CMpts, layerID_CMpts, ['Point_Status', 'EQ_File_Number'], false);
var tot = 0;
for (var f in fs1) {
var fs2 = FeatureSetByRelationshipName(f, relationshipName, ['DummyField'], false);
var cnt = Count(fs2);
if (cnt == 0) {
tot += 1;
}
}
return tot; In this example for each feature the related features are queried and if the count is 0, the total is incremented by one. At the end you should have the number of features that have no related records.
... View more
05-04-2021
09:58 AM
|
0
|
10
|
10792
|
| Title | Kudos | Posted |
|---|---|---|
| 6 | 12-20-2019 08:41 AM | |
| 1 | 01-21-2020 07:21 AM | |
| 2 | 01-30-2020 12:46 PM | |
| 1 | 05-30-2019 08:24 AM | |
| 1 | 05-29-2019 02:45 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-26-2025
02:43 PM
|