|
POST
|
I can view related records in a popup using the Map Viewer. For example, using the service in my previous message, I built a popup to show the information from a related table. var rec = First(FeatureSetByRelationshipName($feature, "DCGIS.ITSPE", ['BIDNAME', 'BIDTOTALDUE', 'BIDCOLLECTED', 'BIDBALANCE']));
if (IsEmpty(rec.BIDNAME)) return 'Not a BID';
return `${rec.BIDNAME}
• Total Due: ${Text(rec.BIDTOTALDUE, '$#,###.00')}
• Collected: ${Text(rec.BIDCOLLECTED, '$#,###.00')}
• Balance: ${Text(rec.BIDBALANCE, '$#,###.00')}` related.png
... View more
11-02-2023
01:39 PM
|
1
|
10
|
3985
|
|
POST
|
Do you have a relationship set up with that specific layer? If you click on the "Valves Over Inspected" layer, does that page contain a list of relationships? For example, this layer has several relationships set up. relationships.png
... View more
11-02-2023
01:04 PM
|
0
|
1
|
3998
|
|
POST
|
The way to do that is to make a list of the fields you want to check and loop through that list to check if that field contains "No". You'll have to use the Expects function when using a variable for the field name. Expects($feature, 'field1', 'field2', 'field3') //replace these with your field names
var fields = ['field1', 'field2', 'field3'] //replace these with your field names
var compliance = 'Compliant'
for (var i in fields) {
if ($feature[fields[i]] == 'No') compliance = 'Not Compliant' //This is case sensitive, so 'NO' does not equal 'No'
}
return compliance
... View more
11-02-2023
08:17 AM
|
0
|
0
|
2767
|
|
POST
|
You can use an Arcade expression to add the thousand separator and your additional text. This example uses the Text function and template literals. `Approximately ${Text($feature["RECORD_AREA_SF"], "#,###")}` label.png This is what the original looked like. Note that the field already has the thousands separator turned on, which isn't reflected in the unformatted label. label1.png
... View more
11-02-2023
07:10 AM
|
1
|
0
|
5626
|
|
POST
|
It might be because there are no intersecting features. Does this work? var z1 = 'Jimbob'
var z2 = 'Scuba Steve'
var z3 = 'Stranger'
var z4 = 'Pedestrian'
var sel = Intersects(FeatureSetByName($map, "Zones"), $feature)
if (Count(sel) > 0) return Decode(First(sel).P_ZONE, "BZ1", z1, "BZ2", z2, "BZ3", z3, "BZ4", z4, "Scooby")
... View more
11-02-2023
06:37 AM
|
0
|
1
|
1950
|
|
POST
|
Intersects returns a FeatureSet, but you need to get the attribute from a single feature to use in your Decode statement. var z1 = 'Jimbob'
var z2 = 'Scuba Steve'
var z3 = 'Stranger'
var z4 = 'Pedestrian'
var sel = Intersects(FeatureSetByName($map, "Zones"), $feature)
//return (sel)
//return(FeatureSetByName($map, "Zones"))
return Decode(First(sel).P_ZONE, "BZ1", z1, "BZ2", z2, "BZ3", z3, "BZ4", z4, "Scooby")
... View more
11-01-2023
01:13 PM
|
0
|
3
|
1996
|
|
POST
|
The value of DateInspected isn't just the date. It will contain the time and time zone information. If you just want the Date , you can format it using the Text function for your When statement. var color = When(Text($datapoint.DateInspected, 'MMMM D, Y') =='December 29, 1899', '#FF0000', '#000000');
return {
textColor: color,
backgroundColor: '',
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
// attributes: {
// attribute1: '',
// attribute2: ''
// }
} This example will give you red text for the items that are on that date. dash.png
... View more
11-01-2023
12:38 PM
|
1
|
1
|
2188
|
|
POST
|
If the first name is only one word, you can use this to get any last name, regardless of how many words it has. var test = 'Jane van der Doe'
var firstName = Split(test,' ')[0]
var lastName = Replace(test, firstName + ' ', '')
return lastName + ', ' + firstName which returns "van der Doe, Jane"
... View more
11-01-2023
08:49 AM
|
2
|
0
|
9134
|
|
POST
|
The number limiter means it will only return that many split items, so that would return just the first name in the array. split.png
... View more
11-01-2023
08:39 AM
|
2
|
1
|
9141
|
|
POST
|
You have to add this code to a Arcade element popup.png
... View more
11-01-2023
07:39 AM
|
1
|
0
|
6224
|
|
POST
|
There are a couple of ways to do that. The original way is outlined in this blog. The more modern way is to use the Arcade element, which allows you to use HTML tags directly. I've simpified your code, using the When function (replacing all the ifs) and template literals. var r1 = $feature.["Risk_Level"];
var output = When(r1 == 0, "Lowest",
r1 < 2, `<p style=color:rgb(142,211,231)>Very low</p>`,
r1 < 3, `<p style=color:rgb(89,184,98)>Low</p>`,
r1 < 4, `<p style=color:rgb(255,255,63)>Moderate</p>`,
r1 < 5, `<p style=color:rgb(254,166,32)>High</p>`,
r1 < 6, `<p style=color:rgb(252,56,57)>Very high</p>`,
`<p style=color:rgb(205,0,103)>Highest</p>`)
return {
type : 'text',
text : output //this property supports html tags
} Note: when posting code, using an image makes it more difficult for us to copy and paste to give an answer. Instead, use the Insert/Edit code sample icon
... View more
10-31-2023
12:44 PM
|
3
|
5
|
6274
|
|
POST
|
What you also could have done is used the DomainName function to get the descriptive name. var commonName = DomainName($feature, "CommonName");
When (commonName == "Yellow Floating Heart", "Nymphoides peltate",
commonName == "Japanese Knotweed", "Reynoutria japonica",
commonName == "Invasive Phragmites", "Phragmites australis",
commonName == "Himalayan knotweed", "Koenigia polystachya",
commonName == "Giant knotweed", "Reynoutria sachalinensis",
commonName == "Fanwort", "Cabomba caroliniana",
commonName == "European frogbit", "Hydrocharis morsus-ranae",
commonName == "Dog-Strangling Vine", "Vincetoxicum rossicum",
commonName == "Bohemian knotweed", "Reynoutria ×bohemica",
commonName == "Black dog-strangling vine", "Vincetoxicum nigrum",
"What")
... View more
10-30-2023
07:29 AM
|
0
|
0
|
2785
|
|
POST
|
Is it possible there's an extra space in the Common Name field ("Yellow Floating Heart ")? Is there any change if you modify the first line? var commonName = Trim($feature.CommonName); You could also use the When function to simplify your code (also using an Implicit return) var commonName = Trim($feature.CommonName);
When (commonName == "Yellow Floating Heart", "Nymphoides peltate",
commonName == "Japanese Knotweed", "Reynoutria japonica",
commonName == "Invasive Phragmites", "Phragmites australis",
commonName == "Himalayan knotweed", "Koenigia polystachya",
commonName == "Giant knotweed", "Reynoutria sachalinensis",
commonName == "Fanwort", "Cabomba caroliniana",
commonName == "European frogbit", "Hydrocharis morsus-ranae",
commonName == "Dog-Strangling Vine", "Vincetoxicum rossicum",
commonName == "Bohemian knotweed", "Reynoutria ×bohemica",
commonName == "Black dog-strangling vine", "Vincetoxicum nigrum",
"What")
... View more
10-27-2023
09:17 AM
|
0
|
1
|
2884
|
|
POST
|
What you'll want to do is to create a variable that holds the first part of your label and use that to append the city type var output = $feature.MCD_NAME + TextFormatting.NewLine;
if ($feature.CTV == "C"){
output += "City";
}
else if ($feature.CTV == "V"){
output += "Village";
}
else if ($feature.CTV == "T"){
output += "Township";
}
return output;
... View more
10-27-2023
07:16 AM
|
2
|
0
|
2730
|
|
POST
|
You can split the phrase with the text "Spring " (with the space after). This also has a check if the string didn't contain the word "Spring " var theArray = Split($feature.Asmt_Roll, "Spring ");
iif (Count(theArray) > 1, theArray[1], "NA");
... View more
10-26-2023
01:46 PM
|
3
|
0
|
1157
|
| Title | Kudos | Posted |
|---|---|---|
| 3 | 2 weeks ago | |
| 1 | 02-04-2025 06:39 AM | |
| 1 | 05-01-2026 08:26 AM | |
| 1 | 04-10-2026 12:01 PM | |
| 1 | 04-13-2026 09:11 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|