Update attributes via workflow
Hi everyone.
I´m looking for a way to update one or more attributefields on the selected features thru workflow. I´m imagening something like this.
The user selects one or more features thru standard geocortex and starts a workflow where the values are either selected in different dropdowns or added (copy - paste) as a string of comma separated values (then I´ll do the parsing of the values).
I´ve succefully added the editertab to my current viewer and changed values in a featurelayer, so I´m able to do it by standard Geocortex.
Any suggestions and/or comments are greatly appreciated
Regards
/Kaare
-
Hi Kaare,
Have you got answer to your question? Thanks.
I am keen to make the something work.
Alex
0 -
To me it looks like you need to build a custom activity that access the underlaying feature service.
- Sune
0 -
What was your solution? I am trying to do the same thing.
0 -
Even I'm trying to do the same. Any help would be appricated.
Thanks,
S
0 -
Use UpdateFeatures activity to update features via a workflow.
The basic process is this:
- Create a feature set of the record/s you want to update using Query Task
- Get your user input values with a Display Form
- Assign the new values to the feature set using the syntax yourFeatureSet.Features(0).Attributes("FieldName")
-
Run the UpdateFeatures activity using the feature set with the updated values
0 -
Thank you for the reply. I am trying to do the same in below worflow. Somereason UpdateFeatures acttiviy is not working.
https://support.geocortex.com/SupportForums/Thread.aspx?pageid=0&mid=2&ItemID=20&thread=58158
Thanks,
S
0 -
I will give it a try and see how your workflow fit into the requirements of my workflow and let you know.
Thank you for your help.
0 -
Hi John, I am attempting to update an attribute of an existing feature and I belive your above workflow is exactly what I need...however I am getting an error at the UpdateFeature activity (Unable to complete operation). I believe my problem is the Where clause in the Query task...what do you think?
https://drive.google.com/file/d/0B9MJ7nq1HIUCX09SQmFBUlV0N3M/view?usp=sharing0 -
Yup, that looks like the problem. I'm guessing this is what you need for your where clause:
"verified = '" & outlist.ToString() & "'"
That'll load the user input from your list box (have to convert it to a string because the variable type is object). The single quotes are also to pass the value as a string to the query, so how the workflow will understand it is "verified = 'Yes'" or "verified = 'No'"
Quick thought on the Display Form. What about having a Yes and No button instead of a listbox? That'd be one less click for the user, and you could use the output button value to calculate your where clause the same way.0 -
Thank you for the suggestion John! I believe I am on the right track however I am now getting this error at the Assign activity..."Index was out of range. Must be non-negative and less than the size of the collection." After some research I beleive this is because the query task is not actually returning any values. Thoughts?
https://drive.google.com/file/d/0B9MJ7nq1HIUCd2VYNWZQRl9yZjA/view?usp=sharing0 -
You're right about where the error is coming from. I can't tell without seeing your data why the query isn't working, but you can try a couple of things with Alert activities:
1) to see how many records are being selected, you can use resultFeatureSet.Features.Count().ToString()
2) You could also have an alert provide you with the string generated by your where clause: "verified = '" & outlist.ToString() & "'"
With that second one, you could try to run that query against your data in ArcMap (the results you get from Select By Attributes should be identical to what you'd get from your Query Task). Then you can troubleshoot to figure out what your where clause really needs to select. For example, I notice that in your ListBox you have the Display with a capital (Yes) but the value without one (yes).0 -
Hmmm...thanks to resultFeatureSet.Features.Count().ToString() I am seeing that no features are actually being selected....now to figure out why! 0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
12 Kommentare