Edit Feature Workflow
Hi all.
We have over 100 Workflow 4.x files that we need to remake in Studio Workflow. I chose one of our simplest workflows to start with and I'm stuck. I've made so many changes, things that were working are no longer working.
The two dropdowns should fill in based on what is already in the database for the feature and the second dropdown should change if the first one changes.
I have never gotten the feature to update. I have looked at the errors in the console and can't figure out what I need to do.
Any help would be appreciated. The workflow json is below.
{"_properties":{"isServerWorkflow":false},"components":[{"id":2,"steps":[{"id":3,"inputs":{},"position":"0,-100","purpose":"start","title":"Start","transitions":[{"id":330,"inputs":{},"position":"90,-40 90,120","sourceConnector":"bottom","target":{"id":118},"targetConnector":"top"}]},{"action":"gcx:wf:forms:form:DisplayForm","id":118,"inputs":{"form":{"accessors":[],"code":"resources.forms[values.id]","values":{"id":116}}},"name":"formSelectParcel","position":"-30,120","title":"Display Form","transitions":[{"id":325,"inputs":{},"position":"90,240 90,280","sourceConnector":"bottom","target":{"id":172},"targetConnector":"top"}]},{"action":"gcx:wf:arcgis:query:QueryTask","description":"Retrieve attributes of a single parcel.","id":121,"inputs":{"geometry":{"accessors":["$formSelectParcel"],"annotations":[{"count":17,"index":0,"kind":"idref"}],"code":"$formSelectParcel.state.geomSelectedParcel.value.geometry[0]","source":"$formSelectParcel.state.geomSelectedParcel.value.geometry[0]"},"outFields":"*","returnGeometry":false,"url":"https://replaceserver.com/arcgis/rest/services/_Zoning/FeatureServer/0"},"name":"queryParcels","position":"-30,390","title":"Query Parcel Layer","transitions":[{"id":375,"inputs":{},"position":"90,480 90,530","sourceConnector":"bottom","target":{"id":127}}]},{"action":"gcx:wf:app::RunOperation","description":"Converts VertiGIS feature input to an Esri Feature","id":127,"inputs":{"operationName":"results.to-graphics","operationParameter":{"accessors":["$queryParcels"],"annotations":[{"count":13,"index":0,"kind":"idref"}],"code":"$queryParcels.feature","source":"$queryParcels.feature"}},"name":"esriFeature1","position":"-30,530","title":"Get Esri Feature (VSW)","transitions":[{"id":376,"inputs":{},"position":"90,640 90,690","sourceConnector":"bottom","target":{"id":131}}]},{"action":"gcx:wf:arcgis::CreateGraphic","description":"Used to assign new attributes to update existing feature","id":131,"inputs":{"attributes":{"accessors":["$esriFeature1"],"annotations":[{"count":13,"index":0,"kind":"idref"}],"code":"$esriFeature1.result.attributes","source":"$esriFeature1.result.attributes"},"geometry":{"accessors":["$esriFeature1"],"annotations":[{"count":13,"index":0,"kind":"idref"}],"code":"$esriFeature1.result.geometry","source":"$esriFeature1.result.geometry"}},"name":"feature1","position":"-30,690","title":"Selected Feature","transitions":[{"id":386,"inputs":{},"position":"90,800 90,970","sourceConnector":"bottom","target":{"id":161}}]},{"action":"gcx:wf:core::Container","id":161,"inputs":{},"position":"-30,970","title":"*Get Attributes","transitions":[{"id":166,"inputs":{},"position":"90,1060 90,1110","sourceConnector":"bottom","target":{"id":250}}]},{"action":"gcx:wf:core::If","id":172,"inputs":{"condition":{"accessors":["$formSelectParcel"],"annotations":[{"count":17,"index":0,"kind":"idref"}],"code":"$formSelectParcel.result === \"submit\"","source":"$formSelectParcel.result === \"submit\""}},"position":"30,280","title":"If","transitions":[{"branch":"true","id":174,"inputs":{},"position":"30,310 -50,310 -50,435 -30,435","sourceConnector":"left","target":{"id":121},"targetConnector":"left"},{"branch":"false","id":176,"inputs":{},"position":"150,310 390,310 390,450","sourceConnector":"right","target":{"id":175},"targetConnector":"top"}]},{"action":"gcx:wf:core::Exit","id":175,"inputs":{},"position":"300,450","title":"Exit"},{"action":"gcx:wf:core::Container","id":193,"inputs":{},"position":"170,1400","title":"Exit"},{"action":"gcx:wf:forms:form:DisplayForm","id":250,"inputs":{"form":{"accessors":[],"code":"resources.forms[values.id]","values":{"id":246}}},"name":"editForm","position":"-30,1110","title":"Edit Form","transitions":[{"id":167,"inputs":{},"position":"90,1230 90,1290","sourceConnector":"bottom","target":{"id":252},"targetConnector":"top"}]},{"action":"gcx:wf:core::If","description":"If user selects submit","id":252,"inputs":{"condition":{"accessors":["$editForm"],"annotations":[{"count":9,"index":0,"kind":"idref"}],"code":"$editForm.result == \"submit\"","source":"$editForm.result == \"submit\""}},"position":"-30,1290","title":"If submit","transitions":[{"branch":"true","id":270,"inputs":{},"position":"-30,1335 -120,1335 -120,1400","sourceConnector":"left","target":{"id":254},"targetConnector":"top"},{"branch":"false","id":274,"inputs":{},"position":"210,1335 290,1335 290,1400","sourceConnector":"right","target":{"id":193},"targetConnector":"top"}]},{"action":"gcx:wf:core::Container","id":254,"inputs":{},"position":"-240,1400","title":"Update Feature","transitions":[{"id":153,"inputs":{},"position":"-120,1490 -120,1510 290,1510 290,1490","sourceConnector":"bottom","target":{"id":193},"targetConnector":"bottom"}]}]},{"id":6,"steps":[{"id":8,"inputs":{},"position":"0,0","purpose":"start","title":"Container","transitions":[{"id":20,"inputs":{},"position":"90,60 90,110","target":{"id":10}}]},{"action":"gcx:wf:core::Container","id":10,"inputs":{},"position":"-30,110","title":"Set Attributes","transitions":[{"id":202,"inputs":{},"position":"90,200 90,250","sourceConnector":"bottom","target":{"id":16},"targetConnector":"top"}]},{"action":"gcx:wf:core::Container","id":16,"inputs":{},"position":"-30,250","title":"Edit Feature","transitions":[{"id":189,"inputs":{},"position":"90,340 90,390","sourceConnector":"bottom","target":{"id":188}}]},{"action":"gcx:wf:arcgis::RefreshLayer","id":188,"inputs":{"layer":{"accessors":["$esriFeature1"],"annotations":[{"count":13,"index":0,"kind":"idref"}],"code":"$esriFeature1.result","source":"$esriFeature1.result"}},"position":"-30,390","title":"Refresh Layer"}]},{"id":50,"steps":[{"id":52,"inputs":{},"position":"0,0","purpose":"start","title":"Container","transitions":[{"id":191,"inputs":{},"position":"90,60 90,110","sourceConnector":"bottom","target":{"id":391}}]},{"action":"gcx:wf:arcgis::RefreshLayer","id":225,"inputs":{"layer":"Zoning"},"position":"-30,230","title":"Refresh Layer"},{"action":"gcx:wf:arcgis::UpdateFeatures","id":391,"inputs":{"features":{"accessors":["$feature1"],"annotations":[{"count":9,"index":0,"kind":"idref"}],"code":"$feature1.feature","source":"$feature1.feature"},"url":"https://replaceserver.com/arcgis/rest/services/_Zoning/FeatureServer/0"},"name":"updateFeatures","position":"-30,110","title":"Update Features","transitions":[{"id":192,"inputs":{},"position":"90,170 90,230","sourceConnector":"bottom","target":{"id":225},"targetConnector":"top"}]}]},{"id":122,"steps":[{"id":124,"inputs":{},"position":"10,130","purpose":"start","title":"Container","transitions":[{"id":388,"inputs":{},"position":"100,190 100,250","sourceConnector":"bottom","target":{"id":128},"targetConnector":"top"}]},{"action":"gcx:wf:arcgis::SetFeatureAttribute","id":128,"inputs":{"attributeName":"TAG","attributeValue":{"accessors":["$editForm"],"annotations":[{"count":9,"index":0,"kind":"idref"}],"code":"$editForm.state.dropDownList_Code.value.value","source":"$editForm.state.dropDownList_Code.value.value"},"feature":{"accessors":["$feature1"],"annotations":[{"count":9,"index":0,"kind":"idref"}],"code":"$feature1.feature","source":"$feature1.feature"}},"position":"-20,250","title":"Set TAG","transitions":[{"id":389,"inputs":{},"position":"100,280 100,330","target":{"id":130}}]},{"action":"gcx:wf:arcgis::SetFeatureAttribute","id":130,"inputs":{"attributeName":"ZoneDesc","attributeValue":{"accessors":["$editForm"],"annotations":[{"count":9,"index":0,"kind":"idref"}],"code":"$editForm.state.dropDownList_ZoneDesc.value.value","source":"$editForm.state.dropDownList_ZoneDesc.value.value"},"feature":{"accessors":["$feature1"],"annotations":[{"count":9,"index":0,"kind":"idref"}],"code":"$feature1.feature","source":"$feature1.feature"}},"position":"-20,330","title":"Set ZoneDesc","transitions":[{"id":384,"inputs":{},"position":"100,360 100,410","sourceConnector":"bottom","target":{"id":210},"targetConnector":"top"}]},{"action":"gcx:wf:arcgis::SetFeatureAttribute","id":210,"inputs":{"attributeName":"OBJECTID","attributeValue":{"accessors":["$objectid1"],"annotations":[{"count":10,"index":0,"kind":"idref"}],"code":"$objectid1.value.value","source":"$objectid1.value.value"},"feature":{"accessors":["$feature1"],"annotations":[{"count":9,"index":0,"kind":"idref"}],"code":"$feature1.feature","source":"$feature1.feature"}},"position":"-20,410","title":"Set OBJECTID"}]},{"id":143,"steps":[{"action":"gcx:wf:arcgis::GetAttributeValue","id":145,"inputs":{"attribute":"OBJECTID","features":{"accessors":["$feature1"],"annotations":[{"count":9,"index":0,"kind":"idref"}],"code":"$feature1.feature","source":"$feature1.feature"}},"name":"objectid1","position":"-30,440","title":"*Get OBJECTID"},{"id":147,"inputs":{},"position":"0,10","purpose":"start","title":"Container","transitions":[{"id":97,"inputs":{},"position":"90,70 90,220","sourceConnector":"bottom","target":{"id":149},"targetConnector":"top"}]},{"action":"gcx:wf:arcgis::GetAttributeValue","id":149,"inputs":{"attribute":"TAG","features":{"accessors":["$feature1"],"annotations":[{"count":9,"index":0,"kind":"idref"}],"code":"$feature1.feature","source":"$feature1.feature"}},"name":"TAG1","position":"-30,220","title":"*Get TAG","transitions":[{"id":98,"inputs":{},"position":"90,280 90,330","sourceConnector":"bottom","target":{"id":152},"targetConnector":"top"}]},{"action":"gcx:wf:arcgis::GetAttributeValue","id":152,"inputs":{"attribute":"ZoneDesc","features":{"accessors":["$feature1"],"annotations":[{"count":9,"index":0,"kind":"idref"}],"code":"$feature1.feature","source":"$feature1.feature"}},"name":"ZoneDesc1","position":"-30,330","title":"*Get ZoneDesc","transitions":[{"id":394,"inputs":{},"position":"90,390 90,440","sourceConnector":"bottom","target":{"id":145}}]}]},{"id":195,"steps":[{"id":197,"inputs":{},"position":"0,0","purpose":"start","title":"Container","transitions":[{"id":203,"inputs":{},"position":"90,60 90,110","target":{"id":201}}]},{"action":"gcx:wf:app::RunCommand","id":201,"inputs":{"commandName":"map.clear-markup"},"position":"-30,110","title":"Clear Markup (VSW)","transitions":[{"id":205,"inputs":{},"position":"90,140 90,190","target":{"id":204}}]},{"action":"gcx:wf:core::Exit","id":204,"inputs":{},"position":"0,190","title":"Exit"}]},{"id":237,"steps":[{"action":"gcx:wf:forms::SetCurrentFormElementItem","id":178,"inputs":{"form":{"accessors":["$$form"],"annotations":[{"count":6,"index":0,"kind":"idref"}],"code":"$$form","source":"$$form"},"matchType":"label","value":{"accessors":["$ZoneDesc1"],"annotations":[{"count":10,"index":0,"kind":"idref"}],"code":"$ZoneDesc1.value","source":"$ZoneDesc1.value"}},"name":"setCurrentFormElementItem7","position":"-30,550","title":"Set Current Form Element Item"},{"id":238,"inputs":{},"position":"0,0","purpose":"start","title":"Event","transitions":[{"id":243,"inputs":{},"position":"90,60 90,110","target":{"id":240}}]},{"action":"gcx:wf:arcgis:query:QueryTask","description":"Query for features.","id":240,"inputs":{"orderByFields":"ZoneDesc","outFields":"ZoneDesc","returnDistinctValues":true,"returnGeometry":false,"url":"https://replaceserver.com/arcgis/rest/services/_Zoning/FeatureServer/0","where":"1=1"},"name":"query1","position":"-30,110","title":"Query Layer","transitions":[{"id":129,"inputs":{},"position":"90,200 90,250","sourceConnector":"bottom","target":{"id":241}}]},{"action":"gcx:wf:forms::GetFormElementItemsFromFeatures","description":"Convert the features into form element items to be used in the element.","id":241,"inputs":{"features":{"accessors":["$query1"],"annotations":[{"count":7,"index":0,"kind":"idref"}],"code":"$query1.features","source":"$query1.features"},"labelFieldName":"ZoneDesc","valueFieldName":"ZoneDesc"},"name":"formElementItems1","position":"-30,250","title":"Get Form Element Items From Features","transitions":[{"id":132,"inputs":{},"position":"90,370 90,420","sourceConnector":"bottom","target":{"id":242}}]},{"action":"gcx:wf:forms::SetFormElementItems","description":"Assign form element items to the element.","id":242,"inputs":{"elementName":"dropDownList_ZoneDesc","form":{"accessors":["$$form"],"annotations":[{"count":6,"index":0,"kind":"idref"}],"code":"$$form","source":"$$form"},"items":{"accessors":["$formElementItems1"],"annotations":[{"count":18,"index":0,"kind":"idref"}],"code":"$formElementItems1.items","source":"$formElementItems1.items"}},"position":"-30,420","title":"Set Form Element Items","transitions":[{"id":104,"inputs":{},"position":"90,500 90,550","sourceConnector":"bottom","target":{"id":178},"targetConnector":"top"}]}],"title":"populate-dropDownList_ZoneDesc"},{"id":247,"steps":[{"action":"gcx:wf:forms::SetCurrentFormElementItem","id":112,"inputs":{"form":{"accessors":["$$form"],"annotations":[{"count":6,"index":0,"kind":"idref"}],"code":"$$form","source":"$$form"},"matchType":"value","value":{"accessors":["$TAG1"],"annotations":[{"count":5,"index":0,"kind":"idref"}],"code":"$TAG1.value","source":"$TAG1.value"}},"name":"setCurrentFormElementItem1","position":"-30,570","title":"Set Current Form Element Item"},{"id":249,"inputs":{},"position":"0,0","purpose":"start","title":"Event","transitions":[{"id":257,"inputs":{},"position":"90,60 90,110","target":{"id":253}}]},{"action":"gcx:wf:arcgis:query:QueryTask","description":"Query for features.","id":253,"inputs":{"orderByFields":"TAG","outFields":"TAG","returnDistinctValues":{"accessors":[],"code":"true","source":"true"},"returnGeometry":{"accessors":[],"code":"false","source":"false"},"url":"https://replaceserver.com/arcgis/rest/services/_Zoning/FeatureServer/0","where":"1=1"},"name":"query2","position":"-30,110","title":"Query Layer","transitions":[{"id":259,"inputs":{},"position":"90,200 90,260","target":{"id":255}}]},{"action":"gcx:wf:forms::GetFormElementItemsFromFeatures","description":"Convert the features into form element items to be used in the element.","id":255,"inputs":{"features":{"accessors":["$query2"],"annotations":[{"count":7,"index":0,"kind":"idref"}],"code":"$query2.features","source":"$query2.features"},"labelFieldName":"TAG","valueFieldName":"TAG"},"name":"formElementItems2","position":"-30,260","title":"Get Form Element Items From Features","transitions":[{"id":260,"inputs":{},"position":"90,380 90,440","target":{"id":256}}]},{"action":"gcx:wf:forms::SetFormElementItems","description":"Assign form element items to the element.","id":256,"inputs":{"elementName":"dropDownList_Code","form":{"accessors":["$$form"],"annotations":[{"count":6,"index":0,"kind":"idref"}],"code":"$$form","source":"$$form"},"items":{"accessors":["$formElementItems2"],"annotations":[{"count":18,"index":0,"kind":"idref"}],"code":"$formElementItems2.items","source":"$formElementItems2.items"}},"position":"-30,440","title":"Set Form Element Items","transitions":[{"id":133,"inputs":{},"position":"90,520 90,570","sourceConnector":"bottom","target":{"id":112}}]}],"title":"populate-dropDownList_Code"}],"deploymentConfig":{"supportedApps":{"VSW":true}},"designerVersion":"5.40.1+4","forms":[{"defaults":{},"elements":{"footer":{"enabled":true,"items":{"0":{"default":true,"index":0,"label":{"markdown":"Submit"},"value":"submit"},"1":{"index":1,"label":{"markdown":"Cancel"},"value":"cancel"}},"section":"footer","type":"ButtonBar"},"geomSelectedParcel":{"autoActivate":true,"enabled":true,"format":"point","index":0,"itemLabel":{"markdown":"Selected Parcel"},"prompt":{"markdown":"Add Location"},"require":true,"rowIndex":0,"rowNumber":0,"size":1,"title":{"markdown":"Geometry Picker"},"type":"GeometryPicker"},"header":{"section":"header","title":{"markdown":"Click on a parcel"},"type":"Header"}},"id":116},{"defaults":{},"elements":{"dropDownList_Code":{"enabled":true,"index":0,"items":{},"prompt":"","rowIndex":0,"rowNumber":0,"title":{"markdown":"Code"},"titleLocation":"beside","type":"DropDownList"},"dropDownList_ZoneDesc":{"dependsOn":"dropDownList_Code","enabled":true,"index":1,"items":{},"prompt":"","require":true,"rowIndex":0,"rowNumber":1,"title":{"markdown":"Description"},"titleLocation":"beside","type":"DropDownList"},"footer":{"enabled":true,"items":{"0":{"default":true,"index":0,"label":{"markdown":"Submit"},"validates":true,"value":"submit"},"1":{"index":1,"label":{"markdown":"Cancel"},"validates":false,"value":"cancel"}},"section":"footer","type":"ButtonBar"},"header":{"section":"header","title":{"markdown":"Update Zoning Code"},"type":"Header"}},"id":246}],"licenseInfo":{"licenseeId":"02cd4e07-210e-cf01-1913-9048d471aeb2"},"start":{"id":3},"transitions":[{"branch":"content","id":163,"inputs":{},"source":{"id":161},"target":{"id":147}},{"branch":"content","id":199,"inputs":{},"source":{"id":193},"target":{"id":197}},{"branch":"populate$dropDownList_ZoneDesc","id":239,"inputs":{},"source":{"id":250},"target":{"id":238}},{"branch":"populate$dropDownList_Code","id":251,"inputs":{},"source":{"id":250},"target":{"id":249}},{"branch":"content","id":264,"inputs":{},"source":{"id":254},"target":{"id":8}},{"branch":"content","id":276,"inputs":{},"source":{"id":10},"target":{"id":124}},{"branch":"content","id":282,"inputs":{},"source":{"id":16},"target":{"id":52}}]}
-
Without telling us at least where you are stuck, it's impossible to answer. Is it the dropdowns? Is it the actual saving of the feature? You say there are errors in the console, what are they? You should also be able to see which activities are executed by running in debug mode: Add &debug=true to the url, and open the console.
That said, you could start by removing the results.to-graphics operation. A query already returns Esri features, so there is no need to convert those.
1
Please sign in to leave a comment.
Comments
1 comment