# Form select widget value

**URL:** <https://community.ofelia.com/t/form-select-widget-value/4981>\
**Category:** Q&A\
**Created:** [12 August 2014 09:32 UTC](https://community.ofelia.com/t/form-select-widget-value/4981 "2014-08-12T09:32:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kasper\_1](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@kasper\_1](https://community.ofelia.com/u/kasper_1)\
**Post date:** [12 August 2014 09:32 UTC](https://community.ofelia.com/t/form-select-widget-value/4981/1 "2014-08-12T09:32:08Z")

</div>

Bonita BPM Community Edition  
Version : 6.3.1

Hello,

Is it possible to set another value than the value which is showed in the select widget.  
like:

Bar becomes: Bar

if it is possible how would i look like in the script for available values?  
today the script is like this:  
[“Bar”, …]  
i think it should look like this:  
[“foo”=\>“Bar”, …]

---

<div class="post-metadata">

**Author:** ![yannick.lombardi](https://avatars.discourse-cdn.com/v4/letter/y/8e8cbc/32.png) [@yannick.lombardi](https://community.ofelia.com/u/yannick.lombardi)\
**Post date:** [12 August 2014 09:41 UTC](https://community.ofelia.com/t/form-select-widget-value/4981/2 "2014-08-12T09:41:40Z")

</div>

Hi,  
Yes, it is possible.  
You can do that by using a HashMap.  
For exemple, I create this map :  
  
HashMap\<String, String\> map = new HashMap\<String, String\>();  
map.put(‘foo’, ‘bar’);  
map.put(‘one’,‘un’);  
map.put(‘two’,‘deux’);

Then, I my the output of widget, I put the script :  
  
return map.get(field\_MyWidget);

If I enter ‘foo’ in the widget, it will return ‘bar’.  
If I enter ‘one’, it return ‘un’.  
etc …

---

<div class="post-metadata">

**Author:** ![kasper\_1](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@kasper\_1](https://community.ofelia.com/u/kasper_1)\
**Post date:** [12 August 2014 19:18 UTC](https://community.ofelia.com/t/form-select-widget-value/4981/3 "2014-08-12T19:18:30Z")

</div>

i found it by my self in the groovy tutorial:  
[http://groovy.codehaus.org/Tutorial+1+-+Getting+started](http://groovy.codehaus.org/Tutorial+1+-+Getting+started)

Insted of:  
  
[“foo”=\>“Bar”, …]

it is:  
  
[“Bar”:“foo”…]  
[“what the option show”:“the value you gonna get”…]
