How many time can i use a featureset variable?
I have a featureset variable returned from a query task. I want get the some info from the first feature of the featureset, e.g. fsElevCert.features(0).attributes("STREET_ADDRESS").ToString(). Then i want to loop through the featureset to get the information from each feature. I got serialization error when i start to loop through the featureset. I am wondering I can only use the featureset one time. I have to run querytask again to get the data.
Please help.
0
-
Hi Yinghong Li
what Activities are you performing in this loop? Are you using an Alert or some other activity that is a client Activity rather than a server Activity?
That is usually when you get this sort of error.
Would you like to post the content of your workflow for people to review?
Regards
Ralph Price0 -
my xaml is more than 32000 so i can not post even part of it.
Here is the squence of it:
1. query task to create featureset.
2. temp= fsElevCert.features(0).attributes("STREET_ADDRESS").ToString()
3. foreach<feature> in featureset
value="Lowest Adjacent Grade: "+feature.attributes("LOWEST_ADJACENT").ToString()+ System.Environment.NewLine+"Finished Floor Elevation: "+feature.attributes("FINISHED_FLOOR").ToString()+System.Environment.NewLine+ "Base Flood Elevation: "+feature.attributes("BASE_FLOOD").ToString()+System.Environment.NewLine+System.Environment.NewLine+"Vertical Datum: "+feature.attributes("VERTICAL_DATUM").ToString()+System.Environment.NewLine+System.Environment.NewLine+"Date: "+feature.attributes("CERTIFICATE_DATE").ToString()
Step 2 worked fine. I got error on step3. I tried to put query task after step2 and it did not work either.
Thanks.0 -
Thanks Ralph.
I found out what caused the problem. I can not put alert inside of featureset loop.0 -
i found out i can use the feature set variable many times, at least 2. 0 -
I confirm: you cannot put an Alert() in a ForEach loop.. WHY!? I've wasted a lot of time. 0 -
In the For Each loop in the example I see Foreach item in FeatureSet1This should beForeach item in FeatureSet1.Features0
Please sign in to leave a comment.
Comments
6 comments