Using Workflow Outputs with edit.display-add-feature
I am trying to use a workflow to pre calculate and populate fields when creating a feature using display-add-feature in Web. I can successfully pass featureAttributes from a workflow output using workflow.evaluate
The issue I have is that I need to calculate fields based on XY coordinates. To do this I chain sketching.capture-geometry into the workflow.evaluate. I process the coordinates (lat and long) and then attempt to pass them with the geometry from the workflow context to edit.display-add-feature as arguments. This doesn't work and I feel like I am missing something simple.
The behaviour I get when passing the arguments is that I am prompted to select a location again and the display form appears with no features populated.

={
"featureAttributes":{"latitude":$getWorkflowInputs1.inputs.context.geometry.y, "longitude":$getWorkflowInputs1.inputs.context.geometry.x},
"geometry":$getWorkflowInputs1.inputs.context.geometry
}
Below is the command chain I am using in Web:
[
{
"name": "sketching.capture-geometry",
"arguments": {
"geometryType": "point"
}
},
{
"name": "workflow.evaluate",
"arguments": {
"id": "a0be56da-45e5-47bd-b6bf-084489105bd1"
}
},
{
"name": "edit.display-add-feature",
"arguments": {
"orientation": "vertical",
"showTitles": true,
"layers": "item://layer-extension/3badab54-22ab-42de-b87d-e1c5073440b9",
"formUITarget": {
"parent": "panel-de20786f",
"attributes": {
"slot": "panel"
}
},
"templateUITarget": {
"attributes": {
"slot": "panel"
}
}
}
}
]We have a number of layers where we need to prepopulate only the XY coordinates. It would be a significant undertaking to create custom feature editing workflows for all of them so we are hoping there is a solution that works with workflow.evaluate and command chaining.
Thank you in advance for anyone who can point me in the right direction for this.
-
Given time I figured out the solution to my own problem. Command chaining does not like multiple inputs so passing multiple workflow outputs did not work in this case.
The solution was to use workflow.run (rather than workflow.evaluate) and have the workflow end with Run Operation edit.display-add-feature. We used workflow inputs to identify the field names for our X and Y fields and then used Set Item Property to assign x and y to our output object (featureAttributes).
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
1 commentaire