I would like to update a feature based on the values from another table. Can I reference other tables using attribute rules and arcade. 'FeatureSets' seems to only refer to referencing other layers in AGOL/Portal.
Thanks!
Hi T L ,
Interesting question. I don't have much experience with Attribute Rules, but the global variable $datastore is supported in Attribute Rules. However, what I understand from what you posted, you have a table in an Enterprise geodatabase that you want to reference and that doesn't seem to work. Is that correct?
I have a view and I want to update a feature table based on the views changes.
Using arcade and attribute rules you can updated fields based on other fields values, I want to updated another tables field based on a fields value. (in an EGDB)
Seems like I need the equivalent to 'FeatureSets' but in a GDB and not AGO/Portal.
Its doesn't seem to work because I don't know if you can or how to do it.
Hi TLongSUGF ,
If you are not able to locate the table or view using the $datastore, I guess it is not possible. Maybe it is best to create a support case and see if they can confirm this and if so, create an idea to include this in a future version. I'm sorry that I can't be more helpful, since I don't have an environment to reproduce this specific use case.
Looks like I can access other features but I cant get this to work. I am trying update one field (SEEDED) based on another field (seeded_mulched) using the parentrowid and uniquerowid. My target points to the Feature class SEEDED field based on the sql expression. Any suggestions? var fc = FeatureSetByName($datastore,'SUDOE.DBO.s123_pandareclam',['SEEDED']); var t_parent = $feature.parentrowid; var sql = "uniquerowid = '" + t_parent + "'"; var target = First(Filter(fc, sql)); var t_seed = $feature.seeded_mulched if ((t_seed) == "Satisfactory") { target = "PASS"; } After enabling the trigger as an attribute rule. When I change seeded_mulched to "Satisfactory", it reverts back to null.
Hi T L ,
Good to hear that you have access to other features. When I look at the expression, there are a couple of comments that I can think of (but keep in mind that I don't really have experience with Attribute Rules):
Instead of doing a static field calculate in order to symbolize my data by the related features I am trying to updated the parent as the related records are edited using attribute rules.
Any suggestions?
var sql = "VALVE_ID = '" + $feature.valveid + "'"
var guid = "'" + TOP(filter(FeatureSetByName($datastore,'UTILITIES.DBO.uti_wdSystemValve',['globalid']),sql),1) + "'";
var date_ = $feature.exercisedate
return {
'edit': [{
'className': 'UTILITIES.DBO.uti_wdSystemValve',
'updates': [{
'GLOBALID': guid,
'attributes': {
'lastexercised': date_
}
}]
}]
}
HiT L ,
When you do a TOP of 1 record, you still have a collection although it has only 1 records. Maybe do a first (this will return the record) and explicitly consult the globalid from that record.
Something like this on line 2:
"'" + First(TOP(filter(FeatureSetByName($datastore,'UTILITIES.DBO.uti_wdSystemValve',['globalid']),sql),1))['globalid'] + "'";
I also haven't seen this type of return value (object) that you are returning. Does that work?
I am trying to return just the globalid of the top record as set the globalID as the variable. It works when I hard code a globalid.
The below works, but it obviously does not use the variables.
var valves = FeatureSetbyName($datastore, "UTILITIES.DBO.uti_wdSystemValve",['globalid'])
var valve = first(filter(valves, "VALVE_ID = '" + $feature.valveid + "'"))
var date_ = $feature.exercisedate
return {
'edit': [{
'className': 'UTILITIES.DBO.uti_wdSystemValve',
'updates': [{
'globalID': '{DE10ED35-B0A6-4E0B-86E7-0012405029F8}',
'attributes': {
'lastexercised': date_
}
}]
}]
}
Hi T L ,
If you try the expression below, what does it return to the console?
var valves = FeatureSetbyName($datastore, "UTILITIES.DBO.uti_wdSystemValve",['globalid'])
var valve = first(filter(valves, "VALVE_ID = '" + $feature.valveid + "'"))
var globaltext = "'{" + valve["globalID"] + "}'";
Console(globaltext);
var date_ = $feature.exercisedate
return {
'edit': [{
'className': 'UTILITIES.DBO.uti_wdSystemValve',
'updates': [{
'globalID': globaltext,
'attributes': {
'lastexercised': date_
}
}]
}]
}