Get One Feature Attribute
I am following the Get Feature Attributes sample workflow that uses the Get Workflow Input activity at the beginning.
While I can get the entire list of attributes for the selected feature, I can't figure out how to get only the OBJECTID into a value, so I can use it as part of a query.
Any help is appreciated.
-
Hi Michael,
I do not know about the workflow you mention, so if you are able to share it with us, I would be happy to help.
In the meantime, some useful information about working with VertiGIS features. As you have normally retrieved these from a VSW operation, you should note the following things:
Iteration
The VertiGIS Features can be iterated using JS Array Operations like forEach(), map() or find()
Example: Find the Feature with OID = 321
- $runOperation1.result.find(feature => feature.attributes.get('OID') === 321)
- Result will be the VertiGIS Feature
Example: Retrieve a list of all OIDs for all features
- $runOperation1.result.map(feature => feature.attributes.get('OID'))
- Result will be a list of OIDs --> [1,2,4,9]
Get Values
Once a VertiGIS Feature is retrieved, the values can be accessed using get()
Example:
- $runOperation1.result.feature.attributes.get('my-attribute')
Set Values
And they can be updated using set()
Example:
- $runOperation1.result.feature.attributes.set('my-attribute', 'my new value')
1
Please sign in to leave a comment.
Comments
1 comment