|
POST
|
Hi Chris Hardie , In Arcade you can retrieve related records and do virtual joins too. Is there a specific reason to join the data? If after you join the data enter and edit an Arcade expression, how are the fields represented if you insert them in the expression builder?
... View more
08-25-2020
01:20 PM
|
0
|
0
|
1256
|
|
POST
|
Hi Invenergy GIS User , Arcade can work with flat tables and featurelayers. Did you construct this line manually or did you use the interface to create it, like this: If the test returns an empty featureset (just field names) you should check is the service is up and working correctly.
... View more
08-25-2020
01:18 PM
|
0
|
3
|
1713
|
|
DOC
|
Hi Nathan Fazer , Quick questions... is your Enterprise 10.8 or later? The FeatureSetByRelationshipName was introduced in Arcade version 1.8 and became available starting with Enterprise 10.8. If you have 10.7.x you could use FeatureSetByName together with a filter on the key field to get the related records. Have a look at: Version Matrix | ArcGIS for Developers and in the function reference you will find in which version it was introduced: Data Functions | ArcGIS for Developers
... View more
08-25-2020
01:10 PM
|
0
|
0
|
20219
|
|
DOC
|
Hi Nathan Fazer , The single and double quotes are mostly interchangeable, although it is better not the mix them too much. Therefore, you will see a lot of examples that use either one or the other or both. I can imagine that this can be confusing. It is best to rely on the interface to help you get the correct syntax for the expression. However, in your case you need to add additional parameters as you already did (although the "false" as the end is missing). I would probably use this for your case: FeatureSetByRelationshipName($feature, "Cases_householdcontacts", ["housecontactname", "housecontactrelationship"], false);
... View more
08-25-2020
10:04 AM
|
0
|
0
|
20219
|
|
POST
|
Hi Craig Gadaloff , Defining symbology does not allow you to dynamically connect to a related table. This would requiere a FeatureSetBy* function and those are not available in the symbology profile. There are also limitations in Collector for the support of Arcade, but as far as I know the beta ArcGIS Field Maps has better support for it. If you would work with Enterprise you could use Attribute Rules to achieve the goal, but there is not support in AGOL for Attribute Rules at the moment. You could probably schedule a task in Pro with a Field Calculation and an Arcade expression to update the information, but it will depend of the frequency of the scheduled task if the data reflects the changes. What I have seen before is that the feature itself contains the state of the project that should be changed when adding another additional record. This will have support everywhere in the platform.
... View more
08-25-2020
09:57 AM
|
0
|
1
|
4502
|
|
DOC
|
Hi Nathan Fazer , Let me try and answer the questions you posted: What is mean by "the exact name of the relationship"? Is that the name of the related table/layer in the feature service? Or the name of that related table/layer in the map itself? If the layer where you are configuring the pop-up has a relationship to another layer or table, you can navigate through the interface and get to the related features. Click on ">" next to the "$feature": Then you will scroll down and below the attributes of the feature you will find "Related records". Click on the ">" next to that: This will list all the related tables and feature layers: Click on the blue link to insert the correct code into the expression builder: I have a point layer of cases and a related table of household contacts. I can't even get this to work: FeatureSetByRelationshipName($feature, 'householdcontacts', ['housecontactname', 'housecontactrelationship'], false); Use the navigation as explained above to see of the name of the relationship is correct. This is the popup of my cases layer. So $feature is getting the point feature, 'householdcontacts' is the related table, and the two fields in brackets are the fields I want to return. But the Test shows Null and the popup shows nothing. The function "FeatureSetByRelationshipName" will return a featureset. It may show when you test the expression in the expression builder, but it will not be shown in the pop-up. You will have to extract the relevant information and construct the string that you want to show in the pop-up.
... View more
08-25-2020
06:26 AM
|
0
|
0
|
20219
|
|
POST
|
Hi [email protected]_Jacobs , Not sure if this helps, but when you delete a feature you may need to use the $originalfeature... See: $originalFeature – New Attribute Rules Arcade Global
... View more
08-19-2020
02:14 PM
|
0
|
0
|
4153
|
|
POST
|
Hi Lea Harper ; I am starting to believe there might be an issue with your Enterprise installation. It is throwing an error with the gisportal/jsapi/jsapi4/esri/core/sql/WhereGrammar.js : Could you reach out to Esri Support? Below the Expression I tested (but the moment it tries to do a count on the result of the filter it fails): //Read out the GlobalID of the seawall feature layer
var GlobID = $feature["globalid"];
Console(GlobID);
//Create a sql expression to query on GlobalID
var sql = "wall_id = @GlobID";
//var sql = "wall_id = '{" + Upper(GlobID) + "}'";
Console(sql);
//Get related table
var tbl = FeatureSetByName($datastore,"Seawall Inspections");
Console(TypeOf(tbl));
//Filter the table using the sql expression
var related_data = Filter(tbl, sql);
Console(TypeOf(related_data));
//Count the resulting records
var cnt = Count(related_data);
Console(cnt);
//Initiate a variable to hold the result
var result = "No inspections available.";
//Check if there are related records found for the current GlobalID
if (cnt > 0) {
var inspection = First(OrderBy(relateddata, 'insp_date DESC'));
result += TextFormatting.NewLine + "Most recent inspection: " + inspection["insp_date"];
}
return result;
... View more
08-19-2020
01:00 PM
|
0
|
0
|
3336
|
|
POST
|
Hi ahmadabusaleh , Here is an example that shows how to do this: https://community.esri.com/message/943005-re-change-font-color-based-on-if-statement?commentID=943005#comment-943005
... View more
08-19-2020
12:19 PM
|
1
|
1
|
2397
|
|
POST
|
Hi lharper_manateegis , You will probably need to check if the globalid is empty (function IsEmpty). If so, just return nothing and check your data, since that should not be the case.
... View more
08-19-2020
11:39 AM
|
0
|
2
|
3336
|
|
POST
|
ahmadabusaleh , yes there is, but not in a single expression in AGOL yet. You would need several expressions, one to return the text and the other to define the color, and use both in a custom HTML pop-up
... View more
08-19-2020
11:30 AM
|
2
|
2
|
2397
|
|
POST
|
Hi Lea Harper , Can you try changing the SQL to: //Create a sql expression to query on GlobalID
var sql = "wall_id = @id"; Too bad that you have Enterprise 10.7.1, otherwise (as from 10.8+) you would be able to use the "FeatureSetByRelationshipName" function to retrieve the related records. Another thing that will not work is the way you extract the max date. In this case it will be a featureset with one record and not the actual date. You need to change it to this (no loop, just take the first record after sorting and extract the information for the correct attribute): var inspection = First(OrderBy(related_data, 'insp_date DESC'));
result += TextFormatting.NewLine + "Most recent inspection: " + inspection["insp_date"];
... View more
08-19-2020
11:16 AM
|
0
|
4
|
2997
|
|
DOC
|
Hi Naomi Begg , Could you create a new question next time? This keep the document a bit cleaner and if others have the same question, they will be able to find an answer more easily. So, what will probably be happening here is the way you added the service to the map. In case you use the map service and not specify the index of the layer, Arcade functionality will be limited: https://maps.taupodc.govt.nz/server/rest/services/property/Reserve/MapServer Configuring Arcade in the pop-up does not provide access to the $map and is restricted to the information in the current feature only: If you add the index of the layer, it will not create a grouplayer and add the layer normally and Arcade functionality should be normal: https://maps.taupodc.govt.nz/server/rest/services/property/Reserve/MapServer/0 Access to $map:
... View more
08-19-2020
06:23 AM
|
0
|
0
|
20219
|
|
POST
|
Hi Lindsay Spencer , So, you have the data in AGOL, but you can't share it outside you organization. I understand, no problem. Since I haven't been able to reproduce the problem in Pro or in AGOL, if you could create a dummy dataset that does not have any sensitive information and share that in a group in AGOL and invite me to that group using my AGOL account "xbakker.spx" I would be able to have a look. That way you will only share a dummy set of data (not publicly, just with the people that have access to the group) and there is no need to export to a FGDB and send that, publish it again, etc. From the screenshot you posted, I can see that there both visited and not visited cases and applying the expression should have worked. However, it would be good to have access to the dummy data to validate a couple of things.
... View more
08-19-2020
06:11 AM
|
0
|
0
|
2161
|
|
POST
|
Hi Lindsay Spencer , Actually, I don't see anything wrong with your expressions. I did a test on ArcGIS Online and the results were correct using your expressions. Since you posted this in the ArcGIS Pro SDK, I assume you are using ArcGIS Pro, so I also did a test to see if anything was different. In this case I used a Utility Network v4 in a FGDB, but the editor tracking fields seem to be named differently ($feature.CREATIONDATE, $feature.CREATOR, $feature.LASTUPDATE and $feature.UPDATEDBY). However, after changing the names of the fields, your expressions worked just fine on my data. It is very strange that in your case when two options are provided ("visited" and "not visited") a third is returned. Would it be possible to have access to (a part of) the data?
... View more
08-18-2020
07:33 AM
|
0
|
3
|
2161
|
| 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 |
2 weeks ago
|