I am trying to pass a field value into the workflow from an HTML5 viewer, based on the feature that was selected. Either via a URL from the map tip or the results pane. But I am not sure how to access the feature values in the workflow.
-
I think that you'll find the answer in Ryan's thorough answer to Zorba's question "Possible to use {$Feature} token with workflow 5?"
0 -
Thanks Zach! That was definitly helpful, but I think were i am getting lost is on the workflow 5 section.
To keep it simple i have a
"get workflow inputs" names input - then
"get feature attribute value" for features I entered "esri.Graphic[]" for attrubute "SVY" (a field name of the layer) - then
"Alert" - "=$attributeValue1.value" - just so i can see the results but i get nothing in the alert box. In the log I can see information about the feature, so i think i am close but not sure what i am getting wrong.
Thanks,
Tom
0 -
First thing I have for you is that the alert activity is not how we should be debugging WF5. The input and output of every client-side activity can be written to your console, though this is not default behavior for HTML5 viewers where you'll need to append "&dev=true" to the url in order to get this information. Be sure to take advantage of logging because it will make your debugging far less painful. It sounds like you've been looking there already, so FWIW there's not much value that using Alert activities is providing you over simply watching the stack in your console.
This brings me to your issue. What is the value of the input to your alert activity in your log? What is the ".value" output of attributeValue1? And perhaps, what is the input value for the ".Features" argument of the attributeValue1 activity and is that what you want to be getting attributes from? It looks like this input value is the issue in your workflow right now, if I understand you correctly then you should be passing your workflow input there.
I also misread your question earlier, I thought that you wanted a whole feature. You can access field tokens just like you would to get text into a mapTip and send just that value to the workflow. Also, if you do want the whole feature, you can access its attributes using syntax like "=$input.inputs.inputName.attributes.attribute". You'll be able to see all of the feature's properties by exploring in your client console, including its geometry.
0 -
Zach,
Thanks for your help. I never quite put together that "inputName" from "=$input.inputs.inputName.attributes.attribute" was what ever I was calling it in the URL. I think just because i made it so simlar $input and .inputs .
Looking at the console to toubleshoot helped me a lot to finally start understanding where the data was coming from and what to put.
Tom
0 -
I make that conflation regularly with regards to workflow inputs, and honestly still haven't arrived at a name for that activity that satisfies me haha!
I'm glad to read that you've gotten things sorted. Getting used to that console log unlocks a lot of potential in Workflow 5... I wish that I had a log of all the wheels I never built because I found something better while poking around an object's properties in there. Good luck moving forward!
0
Please sign in to leave a comment.
Comments
5 comments