Skip to main content

Update attributes via workflow

Comments

12 comments

  • Permanently deleted user

    Hi Kaare,

    Have you got answer to your question? Thanks.

    I am keen to make the something work.

    Alex

    0
  • Permanently deleted user

    To me it looks like you need to build a custom activity that access the underlaying feature service.

    - Sune

    0
  • Permanently deleted user

    What was your solution?  I am trying to do the same thing. 

     

    0
  • Permanently deleted user

    Even I'm trying to do the same. Any help would be appricated.

     

    Thanks,

    S

    0
  • John Nerge

    Use UpdateFeatures activity to update features via a workflow.

    The basic process is this:

    1. Create a feature set of the record/s you want to update using Query Task
    2. Get your user input values with a Display Form
    3. Assign the new values to the feature set using the syntax yourFeatureSet.Features(0).Attributes("FieldName")
    4. Run the UpdateFeatures activity using the feature set with the updated values

     

    0
  • Permanently deleted user

    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
  • Permanently deleted user

    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
  • Permanently deleted user
    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=sharing
    0
  • John Nerge
    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
  • Permanently deleted user
    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=sharing
    0
  • John Nerge
    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
  • Permanently deleted user
    Hmmm...thanks to resultFeatureSet.Features.Count().ToString() I am seeing that no features are actually being selected....now to figure out why!
    0

Please sign in to leave a comment.