First post: I have a feature class for support poles, created in ArcGIS Pro, I have a related (non-spatial) table for sign information and this has attachments enabled. In Collector (Windows) I am able to add a support pole and then add a sign, including adding a file attachment selected from a network drive. I can add several signs, with attachments and all works well. I would like to add the name of the attached file, into a field in my related signs table. I'm new to Arcade and can't figure out the syntax for getting this accomplished. Or maybe what I'm trying to do is not possible ....
I've been able to fill a field in the sign detail table from a record in the originating fc Poles with the following:
Field to update: WorkYard field in the sign details table
......
var tbl = FeatureSetByName($datastore,"SupportPole");
var PoleID = $feature["signSupport_ID_FK"];
var sql = "signSupportID = '" + PoleID + "'";
var Details = Filter(tbl, sql);
var cnt = Count(Details);
var WorkYardVal = "";
if (cnt > 0) {
for (var Detail in Details) {
var WorkYardVal = Detail.WorkYard;
}
}
return WorkYardVal;
.......
and I've been trying to get the following code I found online to work, but to no avail
(I recognize that the $feature is referring to the original point selected which is the Poles feature class, but how do I reach a table that is an attachment table to a related table???
...
var attachmentOptions = {"types":["image/jpeg"]}
var jpgAttachments = Attachments($feature,attachmentOptions)
var jpgName
// Make sure there are attachments before trying to get the properties
If (!isEmpty(jpgAttachments)) {
for (var a in jpgAttachments) {
//look for the specific file name
jpgName = jpgAttachments.name
}
} else {
jpgName = "None";
}
return jpgName;
...
Version of ArcGIS Enterprise:10.7.1
Is your Portal and Server federated:Yes.
Is your deployment setup on a single machine:it’s on multiple machines.
Is your published data hosted;No, it’s referenced in an enterprise geodatabase/SQL Server 2017.
Any assistance would be greatly appreciated.
Thanks.