I have a column lookup which has value/results in field "Lkup" as follows:
1.0 - checklist item 1.0
2.0 - checklist item 2.0
3.0 - checklist item 3.0
4.0 - checklist item 4.0
'
'
10.0 - checklist item 10.0
The checklist values can change based on keyword document and the list can grow to say 10.0, in which case the column lkup would have 1.0 thru 10.0 .
There is a field name for each checklist item above up to 10 checkbox fields.
I only want to display an item in a checkbox field if it is in the lkup.
The fieldnames are checkitem1.0 , checkitem2.0...... checkitem10.0
Field named checkitem1.0 has the following formula for choices which results in the value "1.0 - checklist item 1.0" :
tmp := @Subset(@Subset(@Text(Lkup) ; 1 ); -1 ) ;
@If(@Contains(tmp ; "1.0" ) & flag1.0 = "0" ; tmp ;
!@Contains(tmp ; "1.0" ) & flag1.0 = "0" ; FIELD Checkitem1.0 := "error" ;
FIELD Checkitem1.0 := Checkitem1.0 )
Field named checkitem2.0 has the following formula for choices which results in the value "2.0 - checklist item 2.0" :
tmp := @Subset(@Subset(@Text(Lkup) ; 2 ); -1 ) ;
@If(@Contains(tmp ; "2.0" ) & flag2.0 = "0" ; tmp ;
!@Contains(tmp ; "2.0" ) & flag2.0 = "0" ; FIELD Checkitem2.0 := "error" ;
FIELD Checkitem2.0 := Checkitem2.0 )
I continue this upto 10 fields.
I hide the checkbox field if there is no item and/or checkbox field equals "error".
The point is for users to have somewhat of a dynamic checklist based off keywords.
The problem I'm experiencing is that there may not be an item or key listed from 5 through 7, and the column lkup would look like this:
1.0 - checklist item 1.0
2.0 - checklist item 2.0
3.0 - checklist item 3.0
4.0 - checklist item 4.0
8.0 - checklist item 8.0
9.0 - checklist item 9.0
10.0 - checklist item 10.0
and my checkbox values are out of order for checkitem fields as follows:
checkitem5.0 thru 7.0 value is "error" - this is what I want
checkitem8.0 is found but has wrong value because it's looking for Line 8, hence
tmp := @Subset(@Subset(@Text(Lkup) ; 8 ); -1 ) ;
When this occurs my checkbox formula for choices picks up the wrong checklist item
because it assumes I know ahead of time which line (1, 2, 3, 4....10) to grab the key.
How do I make the checkbox formula more accurate to find the correct line number item to give the correct result?
Thanks in advance.
Some clues:
- did you put the calculations BEFORE the checkbox fields?
- did you use a computed for display field to compute intermediate values?
- did you enable Refresh fields on the main selection field?
- did you enable Refresh choices on doc refresh, for the checkbox fields?
- did you use alias values, like "This is a text|CODE123"?