cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

How to get the Value of a pick-field in a computed expression?

JensN.
13-Aquamarine

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   

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

5 REPLIES 5
mrump
14-Alexandrite
(To:JensN.)

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

JensN.
13-Aquamarine
(To:mrump)

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

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

JensN.
13-Aquamarine
(To:VolkerEckardt)

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

JensN.
13-Aquamarine
(To:VolkerEckardt)

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

Top Tags