Pre-populate dropdown
I need to make a dropdown, and pre-populate it with the allowValues from an attributeType.
I was able to query that attributeType and ot the allowedValues, but couldn’t populate the dropdown with those values.
Here is what I did, please let me know what I did wrong.
The dropdown is like this,
and the code is this, I hardcoded the allowedValues to a json string to make it simple,
def alist = ‘[{“id”:“11”,“name”:“Option 1”},{“id”:“22”,“name”:“Option 2”},{“id”:“33”,“name”:“Option 3”}]’
execution.setVariable(“v_global_audience_list”, alist)
here is the dropdown,
thank you so much
xingwuchai
Posted 5 years ago · Edited 1 year ago·Last reply 5 years ago
4 comments
xingwuchai
OP5 years ago · EditedThat’s great.
thank you again
Former User
·5 years ago · EditedNo worries
Here’s the documentation:
https://developer.collibra.com/workflows/workflow-documentation/
And here’s a list of helpful workflows (ctrl + f on enum and you’ll find a good example), I used this a while back when learning workflows (you learn by doing eh?):
https://productresources.collibra.com/kb_article/helpful-workflows/
Cheers!
Some of these workflows have been moved to the market place, so give that a check too
xingwuchai
OP5 years ago · EditedAlvin,
Thank you so much, you make my day !
My frustration is, I couldn’t find complete documentation about the form field types, I found this “enum” from one of the workflow examples, I had no idea the “dynamicEnum” existed.
I appreciate if you can give me some information about it. I may need it in my development.
Thanks again,
Xingwu
Former User
·5 years ago · EditedHey,
The form property type Enum expects a list of pre-defined values that you hardcode. What you’re looking for is a form type that can accept a variable ie. a dynamicEnum. Check the below:
You’ll need to pass a map like this for example:
If you clear what you have the variable field and add a form value of id: dynamicValuesExpression and Name (using my example): ${map}
That should do what you’re looking for.
Cheers!
Alvin Useree