POST
|
Yes, I missed that the first time I checked the reference page, but finally saw it in another post and got it working. Thanks!
... View more
Tuesday
|
1
|
0
|
73
|
POST
|
This should be super simple to do, but it's driving me crazy. There doesn't seem to be any way of finding a subset of text in a string using Arcade. For example, all I need to do is find out if the word 'Lake' is in a feature name like 'Hurricane Lake FMA'. I can't believe I am having such a hard time with this, I could have done this in 5 seconds using javascript! Find won't work because it returns a number, and even if it returns 0 that is no help if the subtext I need to find starts at index 0. If someone could point out the obvious thing I am missing I would be grateful.
... View more
Tuesday
|
0
|
2
|
120
|
POST
|
Thank you Alix, that's good to know and will save me some time. Do you know if Esri is working on this? It is a major limitation and forces me to create duplicate data, since now I need two layers with the same data, one with and one without geometry. Also, we are working in a testing environment and are just working with a couple of layers until we figure things out. This could get extremely complicated once we try and apply this in a more realistic scenario.
... View more
a month ago
|
0
|
1
|
191
|
POST
|
I am trying to come up with an easy way for staff to add and edit data without having to use ArcPro because licensing and proficiency issues. Some field values, however, need to be auto generated for consistency, so I am using Arcade expressions in the ArcGIS Online web map to auto fill certain fields when records are created. The expressions work when using the ArcGIS Online Edit tool, but we cannot use ArcGIS Online because there is no way to add records to a table from the ArcGIS Online Edit tool. This is a huge problem! The work-around was to create an Experience Builder application because, the EXB Edit widget DOES allow for adding records to a table, but the Arcade expressions do not work!! UUGGG!HHH!!! I need to know if maybe there is some step I am missing, or if anyone has had similar frustrations and has some up with another solution. The field expressions were configured in ArcGIS Online using the Form tool. Here is an example of one of the expressions: var pid = "P1"
var numArr = []
if (Count($layer) > 0 ){
Console("Record count = " + Text(Count($layer)))
for (var row in $layer) {
Console("Property ID = " + row.PropID)
if(!IsEmpty(row.PropID)) {
var cn = Number(Split(row.PropID,'P')[1])
Console("Split number = " + Text(cn))
Push(numArr, cn)
} else {
Console("numArr count = " + Text(Count(numArr)))
if(Count(numArr) == 0) {
pid = "P2"
}
return pid
}
}
pid = "P" + Text(Max(numArr) + 1)
}
return pid This works as expected when I add a new feature from the Web Map: But nothing happens when using the Experience Builder Edit widget If in fact Arcade Expressions are not compatible with EXB for field calculations, it would be nice to know if there are any plans to extend this functionality any time in the near future.
... View more
a month ago
|
0
|
3
|
218
|
POST
|
I didn't have that option turned on and it zooms to my location now, but I still have an issue, however, with no results being displayed in the dropdown menu. I should be seeing an address instead of just coordinates, so something is still amiss.
... View more
03-13-2024
11:34 AM
|
0
|
0
|
134
|
POST
|
I have created an Experience Builder Developer application and configured a Search widget with the Use current location option enabled. It does basically the same thing as the Locate tool in the map and if you have an Action configured can zoom to your location on the map. It can also be used with other widgets such as the Near Me widget by allowing users to automatically search for features a given distance from their location without having to type an address. The problem I am having is that when a user clicks the Use current location button the first time nothing happens. As you can see, the input element is populated with a set of coordinates, but no address shows up in the dropdown menu and there is no zoom action. If I clear the input and try again, it works as expected. As an aside, Experience Builder online has a similar issue, except that the menu populates on the first click, but only with coordinates, and once again there is no zoom action. I have already reported the this to Esri support as a bug, but was wandering if any one besides me has experienced the same issue. I am using EXB version 1.13.
... View more
03-13-2024
11:12 AM
|
0
|
2
|
189
|
POST
|
I am trying to create an attribute rule that populates a field in an origin table when a field in a child table is updated. This could be from adding a new record, or updating an existing record. Both tables have a field named "NID", which is being used as the relationships primary and foreign keys. The NID field in the parent table has unique values and the NID field in the child table can have multiple of the same value, so the relationship is many to 1. The problem I am running into is when I try and return the results. I have looked at examples and read the Esri documentation, but still find if very confusing. I keep getting an error about Global IDs and not sure why. Both of the tables have GobalIDs, but they are not being used as key fields so I don't understand the error. Here is my code so far: var parTble = FeatureSetByName($datastore, "ParentTable", ["NID"], false)
var spTble = FeatureSetByName($datastore, "Species_table", ["NID"], false)
var nid = $feature.NID
//var nid = 4
Console("NID = " + Text(nid))
var nidCnt = Count(Filter(spTble, "NID = @nid"))
Console("Count = " + Text(nidCnt))
var relatedRecord = FeatureSetByRelationshipName($feature, "ParentTable_Species_table", ["Species_table"])
Console("Parent table feature count = " + Text(Count(relatedRecord)))
if(Count(relatedRecord) == 0) {
Console("Adding new record to parent table")
return null
}
return {
//"result": Text(nidCnt) + " records found for NID #" + Text(nid),
"edit": [{
"className": "ParentTable",
"updates": [{
"NID": "NID",
"attributes": {relatedRecord: Number(nidCnt)}
}]
}]
} Also, I know I need to add a new record to the Parent table if a new NID is entered in the child table (ex 7), but I will worry about that when I get this working! 🙂
... View more
02-16-2024
07:09 AM
|
0
|
0
|
167
|
POST
|
@IanRatcliffe Yes, that is the exact issue I was having, but only occurring when I tried to run my script from a script tool. I could run it from the Python IDLE without issue. Apparently, at least from my experience dealing with this, for some reason, the Table Export conversion tool field mappings could not see my file path to the input layer whenever I used a variable for the path. It doesn't make sense because I used the same variable in other geoprocessing tools and they ran just fine. Just some quirky behavior with this tool. I was able to get it working by setting my workspace environment to the gdb that contained the input layer for the field map. This works: outPath = arcpy.GetParameterAsText(0)
TempDB_name = "Temp.gdb"
TempWS = os.path.join(outPath, TempDB_name)
with arcpy.EnvManager(scratchWorkspace=TempWS, workspace=TempWS): # setting the env made the difference
excelToTable = "excelToTable" # This is my input table
fm = ("list_name \"List Name\" true true false 100 Text 0 0,First,#,excelToTable,list_name,0,254;" +
"item_id \"Item ID\" true true false 10 Text 0 0,First,#,excelToTable,item_id,0,254;" +
"itemname \"Item Name\" true true false 100 Text 0 0,First,#,excelToTable,itemname,0,254;" +
"material \"Material\" true true false 50 Text 0 0,First,#,excelToTable,material,0,254;" +
"quantity \"Quantity\" true true false 255 Long 0 0,First,#,excelToTable,quantity,0,254;" +
"description \"Description\" true true false 255 Text 0 0,First,#,excelToTable,description,0,254;" +
"latitude \"Latitude\" true true false 8 Double 14 16,First,#,excelToTable,latitude,0,254;" +
"longitude \"Longitude\" true true false 8 Double 14 16,First,#,excelToTable,longitude,0,254;" +
"altitude \"Altitude\" true true false 255 Float 0 0,First,#,excelToTable,altitude,0,254;" +
"radius \"Radius\" true true false 255 Float 0 0,First,#,excelToTable,radius,0,254;" +
"location \"Location\" true true false 100 Text 0 0,First,#,excelToTable,location,0,254;" +
"timestamp \"Timestamp\" true true false 20 Text 0 0,First,#,excelToTable,timestamp,0,254;" +
"dt \"Datetime\" true true false 255 Date 0 0,First,#,excelToTable,dt,0,254;" +
"project_name \"Project Name\" true true false 50 Text 0 0,First,#,excelToTable,project_name,0,254")
MDD_exportTable = "MDD_exportTable"
arcpy.conversion.ExportTable(in_table=excelToTable, out_table=MDD_exportTable, field_mapping=fm)
... View more
02-15-2024
08:46 AM
|
0
|
0
|
914
|
POST
|
I was wrong about wrapping the fields, that is not the issue. The problem occurs when I use a variable in place of the hard file path for the input table. This is a huge problem, because the path comes from a parameter and must variable. Otherwise it defeats the whole purpose of the script tool, which is the portability! This: "longitude \"Longitude\" true true false 255 Text 0 0,First,#,C:\\GIS_projects\\...\\...\\...\\Temp.gdb\\excelToTable,longitude,0,254; Needs to be this: "longitude \"Longitude\" true true false 255 Text 0 0,First,#,excelToTable,longitude,0,254; If I print the variable excelToTable to the processing details window, they are exactly the same. Any ideas about how I can address this?
... View more
02-14-2024
11:01 AM
|
2
|
3
|
975
|
POST
|
The issue only exists for me when I try and execute a script from a script tool. I have been able to run the Export Table conversion tool successfully in model builder, Arc Pro, and from the Python IDLE. After further investigation, it appears that if I leave the field mapping in one continuous line and don't wrap each field to the next line like I did in my code sample, it works as expected and my fields are updated to the new types. I don't understand why this is only an issue when I execute my script from a script tool, when I can execute the exact same script from the IDLE and it works just fine. I just find the long continuous never ending line of code to be a little annoying because it's messy and I have to scroll, scroll, and scroll some more to see all of the mapping parameters!! It also makes the parameters difficult to edit if needed. To Robert, Yes, I did get that update a couple of days ago, but OIT would have to uninstall it. I will just wait for the next update and see if it makes any difference.
... View more
02-14-2024
10:26 AM
|
1
|
4
|
981
|
POST
|
I have done this hundreds of times, but something seems to have changed in the last Arc Pro update. I have a Python script where I am trying to convert a spreadsheet into a point layer. Below is what I tried first, but the latitude and longitude fields will not convert to Double. # Process: Excel To Table (Excel To Table) (conversion)
arcpy.AddMessage("Converting spreadsheet to DB Table")
logging.info("Converting spreadsheet to DB Table")
excelToTable = os.path.join(TempWS, "excelToTable")
arcpy.AddMessage("Excel to table path " + excelToTable)
arcpy.conversion.ExcelToTable(Input_Excel_File=spreadsheet, Output_Table=excelToTable, Sheet="Debris Harvest Data Florida")
fm = ("list_name \"List Name\" true true false 100 Text 0 0,First,#,excelToTable,list_name,0,254;" +
"item_id \"Item ID\" true true false 10 Text 0 0,First,#,excelToTable,item_id,0,254;" +
"itemname \"Item Name\" true true false 255 Text 0 0,First,#,excelToTable,itemname,0,254;" +
"material \"Material\" true true false 255 Text 0 0,First,#,excelToTable,material,0,254;" +
"quantity \"Quantity\" true true false 255 Text 0 0,First,#,excelToTable,quantity,0,254;" +
"description \"Description\" true true false 255 Text 0 0,First,#,excelToTable,description,0,254;" +
"latitude \"Latitude\" true true false 8 Double 0 0,First,#,excelToTable,latitude,0,254;" +
"longitude \"Longitude\" true true false 8 Double 0 0,First,#,excelToTable,longitude,0,254;" +
"altitude \"Altitude\" true true false 255 Float 0 0,First,#,excelToTable,altitude,0,254;" +
"radius \"Radius\" true true false 255 Float 0 0,First,#,excelToTable,radius,0,254;" +
"location \"Location\" true true false 255 Text 0 0,First,#,excelToTable,location,0,254;" +
"timestamp \"Timestamp\" true true false 255 Text 0 0,First,#,excelToTable,timestamp,0,254;" +
"dt \"Datetime\" true true false 255 Date 0 0,First,#,excelToTable,dt,0,254;" +
"project_name \"Project Name\" true true false 255 Text 0 0,First,#,excelToTable,project_name,0,254;" +
"project_id \"Project ID\" true true false 255 Long 0 0,First,#,excelToTable,project_id,0,254;" +
"username \"Username\" true true false 255 Text 0 0,First,#,excelToTable,username,0,254;" +
"user_index \"User Index\" true true false 255 Long 0 0,First,#,excelToTable,user_index,0,254;" +
"manual_upload \"Manual Upload\" true true false 255 Text 0 0,First,#,excelToTable,manual_upload,0,254;" +
"event_name \"Event Name\" true true false 255 Text 0 0,First,#,excelToTable,event_name,0,254;" +
"id \"ID\" true true false 255 Text 0 0,First,#,excelToTable,id,0,254;" +
"log_index \"Log Index\" true true false 255 Long 0 0,First,#,excelToTable,log_index,0,254")
# Process: Export Table (Export Table) (conversion)
arcpy.AddMessage("Exporting table and mapping fields")
logging.info("Exporting table and mapping fields")
MDD_exportTable = os.path.join(TempWS, "MDD_exportTable")
arcpy.conversion.ExportTable(in_table=excelToTable, out_table=MDD_exportTable, field_mapping=fieldMap)
# Process: XY Table To Point (XY Table To Point) (management)
arcpy.AddMessage("Displaying XY values and creating point feature class")
logging.info("Displaying XY values and creating point feature class")
MDD_tableToPoint = os.path.join(TempWS, "MDD_tableToPoint")
arcpy.management.XYTableToPoint(in_table=MDD_exportTable, out_feature_class=MDD_tableToPoint, x_field="lon", y_field="lat",
coordinate_system="GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision") In the exported table, the latitude and longitude fields are still Text fields and I cannot display XY values using these fields. I also tried adding new fields in the field map and then calculating them, but iy seems as though the Table Export tool is ignoring the field mapping altogether because there are no new fields created to run the Calculate Field tool on. I noticed that in the last ArcPro update, the field mapping tool interface has changed, so I am wandering if something got messed up in the last update. I really don't want to have to write an extra 100 lines of code to do this, so if anyone has any insight please share. 🙂
... View more
02-14-2024
08:36 AM
|
3
|
10
|
1081
|
POST
|
I have a custom Filter widget that was created by another developer and I noticed that on subsequent Filtering tasks, the results didn't make sense. After looking at the code, I think I found the issue, but I don't know how to fix it. From what I can tell the updateQueryParams function isn't working the way I would expect. Instead of overwriting the where clause when called, it seems to be appending the new where clause to the previously loaded where clause. Does any one know if this is the way this function should work? I need to be able to clear the previous clause completely before updating the params, but I am not familiar enough with the 4X api yet. Here is the code: const executeAttributeQuery = async (props) => {
let wc = "";
if (filterItems.length > 0) {
setMessage("")
for (var i = 0; i < filterItems.length; i++) {
if (i == 0) wc += filterItems[i].filter;
else wc += " AND " + filterItems[i].filter;
}
} else {
wc = "1=1";
setMessage('No items to filter')
}
console.log("Before On 345 ");
console.log("where ", wc)
const ds0 = getFeatureLayerDataSource(props.useDataSources[0].dataSourceId);
const ds1 = getFeatureLayerDataSource(props.useDataSources[1].dataSourceId);
const ds2 = getFeatureLayerDataSource(props.useDataSources[2].dataSourceId);
ds0.updateQueryParams(null, props.id); //This seems to be the only
ds1.updateQueryParams(null, props.id); //way to clear the previous
ds2.updateQueryParams(null, props.id); //where clause, but it's not
//optimal
const queryParams: FeatureLayerQueryParams = {
outFields: ["OBJECTID"],
where: wc,
returnGeometry: false,
};
const records0 = await ds0.query(queryParams);
let wc1 = getWcSpatial(records0.records) //returns array of object IDs
console.log("query params ", queryParams) //where clause is correct here.
if (wc1.length > 0) {
const qp1: SqlQueryParams = { where: wc1 }
console.log("attrubute query params ", qp1)
ds0.updateQueryParams(qp1, props.id); //does not update, appends to
//previously loaded where clause.
ds1.updateQueryParams(qp1, props.id);
ds2.updateQueryParams(qp1, props.id);
publishDataFilterAction(props.id, props.useDataSources[0].dataSourceId);
} else {
setMessage("No matches.")
const qp1: SqlQueryParams = { where: "1=1" };
console.log("attrubute query params no match ", qp1)
ds0.updateQueryParams(qp1, props.id);
ds1.updateQueryParams(qp1, props.id);
ds2.updateQueryParams(qp1, props.id);
publishDataFilterAction(props.id, props.useDataSources[0].dataSourceId);
}
} The above code is the source code from the widget.tsx file, but the app has already been exported to the server so any changes I make must be in the compiled code which is not ideal. where clause from 1st query: Horseback riding = 'y' where clause from subsequent query: Horseback riding = 'y' and Bicycling = 'y' The reason I don't want to run the updateQueryParams function to clear out the where clause is because as soon as it runs, all of the features display on the map briefly until the Filter executes.
... View more
01-17-2024
12:15 PM
|
0
|
0
|
215
|
POST
|
I am trying to create custom content for a popup and I need to wrap text around an image. To do this, I am trying to add a 'float' property to the image style, but it is apparently being removed when I close the Arcade editor. I know my syntax is correct and it is not a typo, so is this just something that Esri does not allow? Here is my code: <p style='font-size:1.15em'><b>Species Name</b></p>
<div>
<img src='<img url>' style='width:40%; margin-right:20px; float:left;'>
<p>Descriptive sentence</p>
</div> The other style properties are working so this is very frustrating. As you can see from the images below, the float property is not being applied. This is how it should look after applying the float property in the console: Can someone please let me know what I am missing?
... View more
01-05-2024
08:07 AM
|
0
|
0
|
209
|
POST
|
I have a List Widget that is using a table as it's source data, but the table has 1286 records. Since there is no filter applied when the application loads, the List Widget shows all 1286 records, most of which are repetitive since there are only 33 unique values in my selected field. I would like to either show a pre-filter subset of the data, or just a message ("Please select a county to see fish species"). I did try the 'View for empty selection' option for the source table, but it isn't working. I clicked the gear icon and filtered the data by county as in the image, but the List still wants to fill with all of the records instead of the filtered records (18 in total). The app has been created using Experience Builder Developer v1.12 and you can find a downloaded version here: https://gis.myfwc.com/InDevelopment/Alexander/FishRangeFinder/FishRangeFinder_dev6/
... View more
11-02-2023
06:28 AM
|
0
|
1
|
338
|
POST
|
Does any one know of a way for the Esri popup content to show initially on a mobile device? When clicking a feature in desktop layout, the popup displays and initially shows the content. If you want to hide the content, you must click the caret icon in the top right of the popup. In mobile layout, the content is hidden initially and the caret icon must be click to show the content. This is not optimal to me and I would like the content to show initially on a mobile device like it does on the desktop. You would think there would be a setting some place to allow for "expanding" the content panel on load, but I haven't been able to find one.
... View more
10-30-2023
12:57 PM
|
0
|
0
|
217
|
Title | Kudos | Posted |
---|---|---|
1 | Tuesday | |
1 | 02-14-2024 10:26 AM | |
2 | 02-14-2024 11:01 AM | |
3 | 02-14-2024 08:36 AM | |
1 | 06-27-2023 11:01 AM |
Online Status |
Offline
|
Date Last Visited |
Tuesday
|