Populating a drop down in a workflow form
Good morning! I have a form which I have developed in Workfow Developer and some of the fields are drop downs with more than 20 values. Rather than hard-code all of the values, is there a way to get the form to pull the allowable values from the values that are listed for the attribute itself? I hate having to put them in both places.
Thanks
S Benson
Posted 7 months ago · Edited 7 months ago·Last reply 6 months ago
6 comments
S Benson
OP6 months ago@George Cheung and @Stefan Busch Thanks to both of you, we got it to work. When I had the form in the start object, when executed it would immediatly start the form, which was nice. Now it creates a task, so there are some extra clicks for the user. Not a game-ender, just an annoyance. Any ideas on how to get around that problem? THANKS for everything
Stefan Busch
·6 months agoThe way that we normally handle this is by creating a user task that explains what this workflow is for like: "Welcome to workflow xyz ...".
This will then be used in the start form and as long as you don't have any async behaviour in the workflow all subsequent tasks will also open as pop-up.
This only adds one extra click (you need to close the welcome task) instead of multiple by first having to go to tasks and then find the right one.
S Benson
OP6 months agoNow, thats REALLY clever. I will pass that on! Im glad I asked!
George Cheung
·6 months agoif you wanted to gather the possible values of a selection or multi selection attribute type to present it in a selection field in a form reference, then it would need to be done in a user task not a start form. Prior to the user task will need to be a script task that gathers the allowed values.
For example, to gather the allowed values of the OOTB attribute type Priority and store in a variable that is accessible outside of the script task:
Then in the form reference of the next user task, for the Priority selection field, under the datasource, the possible items can reference using this variable:
{{allowedValuesPriority}}
Stefan Busch
·7 months agoHi,
there certainly is a way. You can configure the drop-down to use the values provided in a variable.
This variable needs to be a list of maps, wher each map has the keys "text" and "value". The text is what is displayed in the drop-down selection and the value is what is stored when you select the specific option. Looks something like the following:
Now you just need to figure out how to populate this list in a script task but that shouldn't be so hard. If you fetch an AttributeType object via the AttributeTypeApi you can use the getAllowedValues() method (in case it is either a SingleValueListAttributeType or MultiValueListAttributeType object) which returns a list of strings (the allowed values).
S Benson
OP7 months agoStefan,
Thanks for the information - I will pass it on to one of the developers to make it work!
Scott