Check attribute value in featureset
I'm trying to do something which seems like it should be extremely straight forward, but I'm hitting roadbloacks with everything I try.
I've got a workflow where the user selects features in the map, they get copied to a different featureclass with few extra attributes . I then do some filtering and changing of visibility on the map and they go and do some manual edits. All working just fine.
Now the user wants me to say that "if the pole type is A, assign design 1. If the pole type is B, assign design 2" (design number would be assigned from a form). Until now I've just been assigning all pole designs as nothing.
Now when I try to add an IF activity saying something like
item.Attributes("PoleType")='B'
OR I've also tried stepping back to
fsSelectedBanners.Features(indexnum).Attributes("PoleType").ToString="B"
I get the below massive error message.
There was a workflow error running activity: Exception has been thrown by the target of an invocation. Workflow 'Tool_BannerCampaigns' failed Aborted exception: 'Type 'ESRI.ArcGIS.Client.Tasks.FeatureSet+<GetEnumerator>d__19' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types.'. Type 'ESRI.ArcGIS.Client.Tasks.FeatureSet+<GetEnumerator>d__19' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types
How on earth do I use the attribute value of each feature in a featureset in an IF acitivity? I'm sure it must be something very simple but I can't work it out.
Hopefully someone can help me on this one, any pointers much appreciated
0
-
I was just shaking my head over a similar error message.
It was because I was trying to loop over the FeatureSet (fs) and not its Features collection (fs.Features)...
item.Attributes("PoleType")='B' should be fine if you are looping over fs.Features with item Type set to 'Graphic'
Worth checking. Cheers0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
1 kommentar