|
DOC
|
Hi Joe Livoti , You can use a single expression which reads out all the information and presents the result. The thing that you can't do is apply any formatting at different parts of the result. In you example you have expression single underlined and all expressions in bold. So, I think it might be better to adjust what you already have. The individual expressions would become: IIF(isEmpty($feature.status14), "", TextFormatting.NewLine + "Footer")
IIF(isEmpty($feature.status14), "", TextFormatting.NewLine + "Status")
IIF(isEmpty($feature.assignedto14), "", TextFormatting.NewLine + "Inspector")
IIF(isEmpty($feature.other14), "", TextFormatting.NewLine + "Other Inspector")
IIF(isEmpty($feature.date_approved14), "", TextFormatting.NewLine + "Date Approved")
IIF(isEmpty($feature.notes14), "", TextFormatting.NewLine + "Notes")
IIF(isEmpty($feature.status15), "", TextFormatting.NewLine + "Foundation")
IIF(isEmpty($feature.status15), "", TextFormatting.NewLine + "Status")
IIF(isEmpty($feature.assignedto15), "", TextFormatting.NewLine + "Inspector")
IIF(isEmpty($feature.other15), "", TextFormatting.NewLine + "Other Inspector")
IIF(isEmpty($feature.date_approved15), "", TextFormatting.NewLine + "Date Approved")
IIF(isEmpty($feature.notes15), "", TextFormatting.NewLine + "Notes")
...and the text in the pop-up would become a single line like this: {expression/expr5}{expression/expr0} {status14}{expression/expr1} {assignedto14}{expression/expr2} {other14}{expression/expr3} {date_approved14}{expression/expr4} {notes14}{expression/expr6}{expression/expr7} {status15}{expression/expr8} {assignedto15}{expression/expr9} {other15}{expression/expr10} {date_approved15}{expression/expr11} {notes15} In case a field is empty the expression will detect it and return an empty string which you wont see and which does not take up an empty line.
... View more
07-23-2020
05:53 AM
|
0
|
0
|
51295
|
|
DOC
|
Hi Joe Livoti , First of all having a pop-up with 210 lines, might be a "little" big and not too user-friendly. So if I understand you correctly, you have a long list of expressions, but some return an empty line. To avoid this you would have to put everything on a "single" line and include the "TextFormatting.NewLine" inside the expression in case you do have a result.
... View more
07-22-2020
11:20 AM
|
0
|
0
|
51295
|
|
DOC
|
Hi JosephLivoti , Actually, you would end up sacrificing more than just the font. I would be just plain text that you return. Using the field names from what Korin showed above, an expression could be like this: var result = "Information:";
if (!IsEmpty($feature.supervisorName)) {
result += TextFormatting.NewLine + "Supervisor Name: " + $feature.supervisorName;
}
if (!IsEmpty($feature.supervisorPhone)) {
result += TextFormatting.NewLine + "Supervisor Phone: " + $feature.supervisorPhone;
}
if (!IsEmpty($feature.supervisorEmail)) {
result += TextFormatting.NewLine + "Supervisor Email: " + $feature.supervisorEmail;
}
return result; Remember, this just returns plain text. There will be better options in the near future. At the UC last week, the team mentioned that it will be possible to define visibility of attributes based on Arcade expressions.
... View more
07-22-2020
06:07 AM
|
1
|
0
|
51295
|
|
POST
|
Hi Colleen Madigan Schelde , On lines 2, 3 and 4 of the original code. when you want to validate if the status is open, closed or in process, you will have to enclose those values in quotes. The other change required is that you will want to not use quotes when you access the values assigned to the color variable (see line 13). In the example below I have changed the first part of the code to make it a little bit more readable. // Status of Survey entry
var color = '';
if ($datapoint.status == 'open') {
color = '#FFBEBE';
} else if ($datapoint.status == 'closed') {
color = '#D3FFBE';
} else if ($datapoint.status == 'inprocess') {
color = '#BEE8FF';
}
return {
textColor: '',
backgroundColor: color,
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
// attributes: {
// attribute1: '',
// attribute2: ''
// }
}
... View more
07-19-2020
02:27 PM
|
2
|
2
|
5425
|
|
POST
|
Hi Varun Sehgal , Would it be possible to have access to a subset of the data? This will make it easier to see how the two are related and if the FeatureSetByRelationshipName function is something that you can use in your case.
... View more
07-19-2020
08:43 AM
|
1
|
1
|
2669
|
|
POST
|
Hi Varun Sehgal , Sorry for the delay and thanks for the additional explanation. I assume that you used an Arcade expression to show this in the pop-up? If so, the same expression can be used in the field calculation (even in ArcGIS Online), since you are accessing the data using the datastore. How you tried that?
... View more
07-17-2020
04:08 PM
|
0
|
3
|
2669
|
|
POST
|
Hi jborgion I don't think the semicolon is required. The "var " at the beginning is.
... View more
07-17-2020
11:58 AM
|
1
|
0
|
10406
|
|
POST
|
Hi Joe Borgione , In Arcade you can also split long lists over multiple lines: var myList = ['blahblah0', 'blahblah1', 'blahblah2',
'blahblah3', 'blahblah4', 'blahblah5']; To combine multiple list you don't have the easy sum of the lists as you have in Python but you can do this: var lst1 = ['blahblah0', 'blahblah1', 'blahblah2'];
var lst2 = ['blahblah3', 'blahblah4', 'blahblah5'];
var lst = lst1;
for (var i in lst2) {
lst[Count(lst)] = lst2[i];
}
return lst; ...or even this (which will not work for lists with numeric data): var lst1 = ['blahblah0', 'blahblah1', 'blahblah2'];
var lst2 = ['blahblah3', 'blahblah4', 'blahblah5'];
var lst = Split(Concatenate(lst1, "#") + "#" + Concatenate(lst2, "#"), "#");
return lst;
... View more
07-17-2020
11:49 AM
|
2
|
2
|
10406
|
|
POST
|
Hi Varun Sehgal , I notice that you are using an example Arcade expression that I published in the past using an example of fire hydrant maintenance history. If you have a relationshipclass between the two layers, you can use the function "FeatureSetByRelationshipName" to access directly the related records. You will need the exact name of the relationship te be able to use this. You can use the GlobalID and a filter, but the syntaxis of the sql will be different. In the loop you construct a multi line text combining feature height and attachment type. Is that what you want?
... View more
07-17-2020
05:53 AM
|
2
|
5
|
2669
|
|
POST
|
Hi Josh Harris , Here is an example expression that you can use: var fs = FeatureSetByName($map,"The Name of the other point feature service");
var buf = Buffer($feature, 500, "meter");
var fs_filtered = Intersects(fs, buf);
var cnt = Count(fs_filtered);
var min_dist = 999;
if (cnt > 0) {
for (var f in fs_filtered) {
var dist = Distance($feature, f);
if (dist < min_dist) {
min_dist = dist;
// if you want to know which feature is nearest,
// you should extract that here
}
}
}
return min_dist;
... View more
07-16-2020
07:24 AM
|
4
|
4
|
7492
|
|
POST
|
Hi Josh Harris , The short answer is yes you can. However, you will need to consider performance and be smart on determining the nearest point. Als the other service should be in the same map or in the same datastore to have access. You can access the other service and start processing each feature one by one to determine the nearest point. If the service has a lot of points, this will come with a cost (performance wise). You can reduce the number of features to process if you have some idea about the maximum distance in which you are sure to find a point. This would allow you to create buffer around the input feature, and use the Intersects function to query the other layer and after that loop through the subset of feature to get to the nearest. So to provide you with some more advise, it would be necessary to share how many feature you have in the other feature service and if there is a distance you can define to avoid processing a large quantity of features.
... View more
07-16-2020
06:13 AM
|
1
|
6
|
7492
|
|
POST
|
Hi Cameron McArtney , Before looking at the code below, I have a question? What version of Enterprise do you have installed. This will define what functions are available to you. To be sure consult the version matrix: Version Matrix | ArcGIS for Developers I have included a couple of Console statements to write to the console to see if you have any results and what you get on the way. Can you try this and post back the information printed to the console? // assign table
var tbl = FeatureSetByName($map,"TABLE");
Console(Count(tbl));
// assign pin
var pt = $feature['PIN'];
Console(pt)
// create sql variable
var sql = "PIN = @pt";
Console(sql);
// run query on table
var query = Filter(tbl, sql);
// it is good to check if you have any results
var cnt = Count(query);
Console(cnt);
var result = "There are " + cnt + " Result(s):";
if (cnt > 0) {
// sort the featureset
var order = OrderBy(query, 'date DESC');
// construct the result
for (var feat in order) {
// change "YourFieldName" for your field name
result += TextFormatting.NewLine + feat.YourFieldName;
}
}
return result;
... View more
07-15-2020
12:32 PM
|
1
|
1
|
10921
|
|
POST
|
Hi Ben Wan , What you need is to calculate two buffers and determine the symmetric difference between those polygons and test against that polygon. In the example below you would continue using the function "Intersects" using the variable "pol": var buf1 = Buffer($feature, 250, "feet");
var buf2 = Buffer($feature, 500, "feet");
var pol = SymmetricDifference(buf1, buf2);
An example to show how this works: // create a dummy point at 0, 0
var pointJSON1 = { "x": 0.0, "y": 0.0, "spatialReference": { "wkid": 3857}};
var pnt1 = Point(pointJSON1);
// create two buffers around point (for simplicity I use 250 and 500 meters)
var buf1 = Buffer(pnt1, 250, "meter");
var buf2 = Buffer(pnt1, 500, "meter");
// Create the symmetric difference which will contain only the larger outer buffer polygon
var pol = SymmetricDifference(buf1, buf2);
// create a second test point at 0, 350 that will be inside the polygon
var pointJSON2 = { "x": 0.0, "y": 350.0, "spatialReference": { "wkid": 3857}};
var pnt2 = Point(pointJSON2);
// test against the point 0,0 (will not intersect with polygon)
Console("pnt1 intersects: " + Intersects(pol, pnt1));
// test against the piont 0, 350 (will intersect with polygon)
Console("pnt2 intersects: " + Intersects(pol, pnt2));
return "OK";
This will return in the Console: pnt1 intersects: false
pnt2 intersects: true
... View more
07-14-2020
05:05 PM
|
0
|
0
|
1039
|
|
POST
|
Hi heathmanderson , I am glad you made it work. Thanks for sharing back your solution.
... View more
07-10-2020
11:44 AM
|
0
|
0
|
3282
|
|
POST
|
Hi Adam Abeles , I am not sure if this will work the way you want it to work, but I can give you some pointers on what is going wrong with the expression you have at this moment. In your third line you concatenate a text with a featureset (remember the variable "circuits" represents featureset with 0 or more features). In case you are trying to get the predominant BASE_CIRCUITID from the primary overhead conductors, you could use the GroupBy function or a loop to get that result. If you have your data residing in an Enterprise geodatabase, you could also implement an attribute rule.
... View more
07-09-2020
12:53 PM
|
0
|
0
|
1274
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-09-2020 09:26 AM | |
| 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 |
| Online Status |
Offline
|
| Date Last Visited |
4 weeks ago
|