Form Element Value Population on Load
I'm encountering an issue with dynamic form population. I have a workflow that does the following:
- User enters an ID value in one form
- A feature service is queried for this ID
- The single returned feature's “attributes” property is saved as an object in a Create Value activity
- An array that maps the attribute values to form elements is also created by Create Value
- [{"form": <form element ID>, “field”: <service field name>},{},{}…]
- In the next form, in the load event for the header the aforementioned array is iterated and the attribute values are used to populate every form element
I've noticed two odd things about this and maybe it's an async issue or something else I'm missing.
- In the Workflow sandbox (fresh browser page load), the first time I run the workflow, none of the DropDownList elements populate (all other elements populate fine, even ListBox elements)
- If I click Run Workflow immediately again, the DropDownList elements populate without issue
- In my Web app (VertiGIS Studio Web), when I run the workflow from a toolbox button, none of the DropDownList elements populate, and subsequent attempts to run the tool do not change the outcome, as happens in the sandbox.
- UPDATE: Not sure what I did, but the app seems to now match the sandbox, the first run of the workflow does not populate any ListBox elements, but subsequent runs (without refreshing browser), do work.
I don't believe it's an issue with my workflow and how I populate the elements because I've been able to get every element to populate with this method. I have an inkling that it's a timing/async issue, especially since during the 2nd run of the workflow (as mentioned re: workflow sandbox above), the form loads much faster than the first time I run the workflow.
Wondering if anyone has encountered this or has any suggestions. I'd be happy to share the workflow, too.
-
Hi Jack! We are experiencing the same issue. We can click on a feature, launch a workflow, and sometimes the form prepopulates and sometimes it doesn't. This doesn't happen all the time, so it is hard to replicate. It is almost as if the form is loading before it has the values. We tried adding a delay before the form load and it seems to help but isn't 100% effective. Any other solutions out there?
0 -
Hey Stephanie Widas,
It's been so long now that I can't 100% remember, but I'd hazard a guess that I may have not been using the right activities to populate some of the form element types, and eventually realized that. This workflow doesn't suffer from this anymore and all of the attributes load into the form properly.
How are you taking attributes from a Feature and pushing them into your form?
0 -
Hi,
We’ve experienced similar behavior when prepopulating values in form elements. As you mentioned, it seems likely to be a timing issue, where the form renders before the element has finished loading its values.
I’ve noticed this more frequently when using the form header load activity to populate element values. Since each element has its own load activity, that may be the more appropriate place to load its values. That said, I haven’t spent enough time experimenting with the differences between the two approaches to say for certain.
0 -
Kevin Arden I think you may be right in using the load activity on each element instead, to ensure it's initialized before population. I did not do that because the form I had to construct had over 100 fields, so it was easier to use the singular header load event. I suppose it's partly a matter of what your form looks like and the amount of effort expended to pre-populate it, but it surely seems like a timing issue.
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
4 kommentarer