How to get the Value of a pick-field in a computed expression?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
How to get the Value of a pick-field in a computed expression?
Hi @all,
with IM 10.7 we want to concatenate some fieldvalues into another field of the same item. For this we had created a shorttext-field with a computation. One of the fields we want to use is a pickfield, and (as stated in the documentation) pick-fields always return only the number of the selected entry and not the value. Are their any known workarounds which you can share with me? Thanks,
cheers, Jens
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Perhaps this workaround helps.
Assuming there are not hundreds of pick values, you can create a simple if-then-else statement and set the to-be-returned values explicitely.
FieldType: Short Text
Calculation: (PickField=1?"First Pick Value":(PickField=2?"Second Pick Value":"Last Pick Value")).
Not tried but perhaps it helps.
For sure you need to update the values acccordingly to what you have defined in the pick field itself.
Volker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Jens,
have you tried "getFieldValue(item#, field)"
<copy from function classes documentation>
"Returns a field value in a specific item ID. For example, getFieldValue (234, “Found in Build”) returns a Found in Build field value of 7415 for Defect 234. "
in you case it would be something like
(RelExists("YOUR_IBPL_PICK_NAME") )? isEmpty( getFieldValue(YOUR_IBPL_PICK_NAME, THE_IBPL_PICK_DISPLAY_FIELD),Text("-unknown-")) : emptytext()
HTH Matthias
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Matthias,
unfortunately "getFieldValue(item#, field)" works for the most fieldtypes except ordinary pick-fields. A pick-field always returns the number of the selected entry, when used in a computation. Another try was to substitute the entry-number with its value inside of the computation, but it doesnt work either.
It seems that this is working only by a trigger, but i wanted to avoid using a trigger.
cheers, Jens
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Perhaps this workaround helps.
Assuming there are not hundreds of pick values, you can create a simple if-then-else statement and set the to-be-returned values explicitely.
FieldType: Short Text
Calculation: (PickField=1?"First Pick Value":(PickField=2?"Second Pick Value":"Last Pick Value")).
Not tried but perhaps it helps.
For sure you need to update the values acccordingly to what you have defined in the pick field itself.
Volker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Volker,
thanks for your answer. I did actually try some kind of this if-then-else stantement, but maybe not deep enough. I will look into it again...
cheers, Jens
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Volker,
it works. First i tried if-then-else-statements for the whole concatenation. This was way to complex. Now i tried to put this statement inside of the concatenation-statement. It is still complex, but not at that level as before, and it works!
thanks, Jens
