Inserting Variable Value into Editable Feature Layer
I'm having trouble getting the value of a variable (which is filled in by the user on a form) into one of the attributes of an editable feature layer. It is a text field. I've tried using the Assign tool, but it's not working for me. I'm not a programmer, so I could very well have the syntax wrong, but I'm not getting any errors.
-
Have you tried doing an "alert" so you know you have something? The varibale is a string as well? What is the syntax you are using to populate your feaure layer?
Ryan
0 -
Hi Ryan
I was never able to find a way to do this and ended up writing a workflow to do it. There doesn't appear to be any way to reference the input boxes in the auto-generated form for attribute editing.
Regards
Ralph
0 -
I have an Assign Activity as ZoningQuery.features.first().attributes("CaseNumber") = rezoningcasenumber where ZoningQuery is the selected polygon on my editable Feature Layer, CaseNumber is the attribute I want to fill in, and rezoningcasenumber is the variable that is filled in by the user.
0 -
And yes, the variable is a string.
0 -
might be clue-gee but you could use the sql command to update the db table of attributes with the variable, before you edit, or you could build a workflow to update records.
0 -
Have you followed this activity with the Add Features or Updates Features activity?
0 -
I tried the Update Features Activity but didn't work. I use the Add Feature before trying to populate its attributes. In short, what my workflow is doing is having the user select a parcel(s), presenting them a form to fill out case numbers, names, dates, etc., creating some reports, then takes the selected parcel(s), copies them into another feature class (my editable feature layer), then I'd like for it to fill the attributes of this newly created polygon with some of the items from the form.
0 -
Thank you Ryan! I will look that over and see if I can tell where I'm going wrong.
~Sara
0 -
Hi Sara
when I said that I hadn't found a way to do this I thought that you were saying that you wanted to prepopulate values into the edit attributes default 'form' that is generated based on what fields you have configured in the REST Manager to show up there.
One thing that you might like to do with Ryan's workflow as you peruse it is to rename some of the Sequences etc to better describe what happens within that sequence. Another thing to watch if you make modifications like adding in Alert activities is the presence of serialization issues that mess up the features that you are trying to use as the input to the Update Features.
http://support.geocortex.com/how-to-get-rid-of-esri-serialization-errors
http://support.geocortex.com/SupportForums/Thread.aspx?pageid=0&mid=2&ItemID=20&thread=46996
http://support.geocortex.com/SupportForums/Thread.aspx?pageid=0&mid=2&ItemID=20&thread=47438
Are you trying to update features or create entirely new ones?
Regards
Ralph
0 -
I'm creating entirely new ones. I can get the features created and for the time being, am having the user manually edit the attributes in the Results Window. But I would like for it to autopopulate the fields....It's a little overkill to me that she has to enter the same information twice.
0 -
You can auto-populate the forms with any attribute or value using the Runtime Modifications at the botton of a Form. Put in an Assign activity in there. For example, if you want to populate your TextBox2 with a variable, you'd do form.Find(Of TextBoxFormItem)("TextBox2").DefaultText = myAttVar in the Runtime Modifications to assign that variable to populate the default text for that text box.
See the Help for Display Form and scroll down. I have examples if you need them too.
Ryan
0 -
Sorry, I should have been a little clearer. I don't want to autopopulate the form. I want to autopopulate the new feature layer's attributes with info from the form. I haven't gotten a chance to look at the posted example, but will try to today.
0
Please sign in to leave a comment.
Comments
12 comments