POST
|
I'm trying to create a calculated expression to populate a value in one of my fields. The expression gets the address of a feature that's within 100 feet of the feature the user is adding. If the expression doesn't get an address I want it to do the same process but with a different layer. I'm using literal strings in Arcade to populate the field. Can I not use multiple literal strings in the expression? Below is my Arcade expression. if (IsEmpty(Geometry($feature))){
return null
}
var case = FeatureSetByName($map,"Active Container Related SRs")
var bufferedLocation = Buffer($feature, 100, "feet")
var candidateParcels = Intersects(case, bufferedLocation)
var featuresWithDistances = []
for (var f in candidateParcels){
Push(featuresWithDistances,
{
"distance": Distance($feature, f, "feet"),
"feature": f
}
)
}
function sortByDistance(a,b){
return a["distance"] - b["distance"]
}
var sorted = Sort(featuresWithDistances, sortByDistance)
var closestFeatureWithDistance = First(sorted)
if (IsEmpty(closestFeatureWithDistance)){
// return null
var rcase = FeatureSetByName($map,"Active Recycling Container Related SRs")
var rParcels = Intersects(rcase, bufferedLocation)
var recycle = []
for (var i in rParcels){
Push(recycle,
{
"distance": Distance($feature, i, "feet"),
"feature": i
}
)
}
return `${recycle["feature"]["IncidentAddress"]}`
}
return `${closestFeatureWithDistance["feature"]["IncidentAddress"]}`
... View more
10-17-2022
11:07 AM
|
0
|
1
|
182
|
POST
|
Thanks for the reply. I'm assuming that the Sort function is correct. I got it from #7 from this ESRI blog article
... View more
08-25-2022
07:58 AM
|
0
|
0
|
761
|
POST
|
Justin, I took a look at the logs and I saw that the error was "The target server failed to respond" so I changed the layer to a more reliable one and now it's working as expected. Thanks for your help. Michael
... View more
08-25-2022
07:56 AM
|
1
|
0
|
761
|
POST
|
I'm trying to use a calculated expression to auto populate several fields in a layer that I'm collecting. I have 3 expressions that are doing basically the same thing, but only 2 of the 3 expressions work. I get an error that says Failed to Calculate and because of this error I can't submit the collected point. Below is the Arcade expression that I'm using. The 3 calculated expressions are using this same code, but pulling data from different layers from the map. if (IsEmpty(Geometry($feature))){
return null
}
var parcels = FeatureSetByName($map,"Parcels")
var bufferedLocation = Buffer($feature, 100, "feet")
var candidateParcels = Intersects(parcels, bufferedLocation)
var featuresWithDistances = []
for (var f in candidateParcels){
Push(featuresWithDistances,
{
"distance": Distance($feature, f, "feet"),
"feature": f
}
)
}
function sortByDistance(a,b){
return a["distance"] - b["distance"]
}
var sorted = Sort(featuresWithDistances, sortByDistance)
var closestFeatureWithDistance = First(sorted)
if (IsEmpty(closestFeatureWithDistance)){
return null
}
return `${closestFeatureWithDistance["feature"]["ADDRESS"]}`
... View more
08-04-2022
07:11 AM
|
0
|
4
|
848
|
POST
|
Thanks for the reply. I was able to use the first 2 suggestions to get around the token timing out. I eventually decided that attaching the pictures was the best solution for me.
... View more
07-08-2022
07:51 AM
|
0
|
0
|
187
|
POST
|
I'm using Power Automate to create an email once a survey is submitted. The email contains 3 photos that are created in survey. These photos are in the email body not attachments. After about 30-40 mins, the photos are no longer displaying, but are displaying red Xs instead. I'm using an expression like feature attachment URL/?token=Portal Info Token to get the picture. Is this issue possibly caused by the portal info token expiring? If so, is there a way to keep the token active for longer or get the attachment URL without having to use a token? Thanks in advance!
... View more
06-16-2022
12:01 PM
|
0
|
2
|
271
|
POST
|
I've only really used Survey123 Connect so I'm not sure what the capabilities are when creating a survey using the web.
... View more
06-03-2022
11:31 AM
|
0
|
0
|
461
|
POST
|
You're getting a random string of text because Assignment Type is a GUID field. Maybe you can use an if statement in Survey123 to change the text string to the name of the assignment.
... View more
05-31-2022
01:14 PM
|
0
|
2
|
481
|
POST
|
Thanks for the response Ismael. I haven't registered the locator as an item, but if I do that then I should be able to use the locator?
... View more
04-25-2022
11:38 AM
|
0
|
0
|
194
|
POST
|
I'm creating a new survey and wanted to use a locator that my organization has created on our server. I was reading and saw that it's possible to use a custom locator by grabbing the itemID of the locator, but is there a way to use the URL of a locator that isn't on ArcOnline? Thanks, Michael
... View more
04-21-2022
09:56 AM
|
0
|
2
|
225
|
POST
|
I was just wanting the font size to be big enough so that the note catches the eye of the user and that the user will actually read the note. Edit: I came across this blog about using HTML tags and I decided to go a different direction than initially planned. I decided to use a DIV element in the label and everything is working as expected now. Thanks for taking a look at this for me!
... View more
04-14-2022
06:01 AM
|
2
|
1
|
2866
|
POST
|
I have a note in my survey and I was wanting to change both the size and the color of the text. I see from the documentation that this is possible, but how would I format it so that I can control both the size and the color? Currently, I'm using if(${field} = "Yes",'<font size="5"><font color="blue">The address IS within the city limits.</font></font>','<font size="5"><font color="red">The address IS NOT within the city limits.</font></font>') The if statement works, but if I change the font size to anything other than 5, then the font size goes back to the default size. Thanks for any help!
... View more
04-13-2022
01:09 PM
|
0
|
3
|
2917
|
POST
|
There are 3 child versions under default and I'm editing one of the child versions.
... View more
10-21-2021
08:36 AM
|
0
|
0
|
487
|
POST
|
Thanks for the reply Joe. The layer being edited is in a traditional versioned GDB and the script is being run within a Pro session. The workflow is that I add a point with some basic attributes then run the script to populate the rest of the attributes for the point.
... View more
10-19-2021
08:24 AM
|
0
|
2
|
519
|
POST
|
I'm using ArcGIS Pro version 2.8.3 and after I run a Python script, the attribute table for the layer that the script edited doesn't refresh until I click "Reconcile". Once I click "Reconcile", the attribute table will refresh and show the edits that the script created. The Python script runs the intersect tool and then does a field calculation. I've disabled the cache on the layer and the attribute table refreshed for a day or two after running the script, but now the table doesn't refresh anymore. Is this a bug in Pro or is there something else that is causing the attribute from refreshing? Thanks in advance!
... View more
10-19-2021
07:59 AM
|
0
|
5
|
543
|
Title | Kudos | Posted |
---|---|---|
1 | 03-29-2023 01:20 PM | |
2 | 11-07-2022 07:38 AM | |
1 | 01-21-2021 01:32 PM | |
1 | 08-25-2022 07:56 AM | |
2 | 04-14-2022 06:01 AM |
Online Status |
Offline
|
Date Last Visited |
Friday
|