14 Replies Latest reply on Oct 28, 2013 9:46 AM by eliahoo

    how to make a check box set validation of list content work.

    eliahoo

      Title

      how to make a check box set validation of list content work.

      Post

           I have a record details layout that includes a list that is populated from a table of master values with fields that include COURSE_NO, COURSE_NAME, and AGENCY

            

           It also includes a container that has a “Checkbox set” control that  is populated from a value list

           see image 1 and 2 attached

           The check boxes are “checked” when the control evaluates the list to see if it is populated by elements represented by the checkbox names

            

           The control works, except for the last value that was added by me, it does not get checked when the appropriate record is added to the list.

           The display data is drawn from a calculation field:

           See Image 3 attached

           With the following content:  CERT_LIST_CHECKS =

           If(

           PatternCount ( CERT_LIST ; "AWCT Arduous WCT" ); "AWCT Arduous WCT¶"

           ) &

           If(

           PatternCount ( CERT_LIST ; "I-100 Introduction to Incident Command System" ); "I-100 Introduction to Incident Command System¶"

           ) &

           If(

           PatternCount ( CERT_LIST ; "IS-00700 National Incident Management System: An Introduction" ); "IS-00700 National Incident Management System: An Introduction¶"

           ) &

           If(

           PatternCount ( CERT_LIST ; "L-180 Human Factors in the Wildland Fire Service" ); "L-180 Human Factors in the Wildland Fire Service¶"

           ) &

           If(

           PatternCount ( CERT_LIST ; "RT-130  Annual Wildland Refresher Course" ); "RT-130  Annual Wildland Refresher Course¶"

           ) &

           If(

           PatternCount ( CERT_LIST ; "S-130 Firefighter Training" ); "S-130 Firefighter Training¶"

           ) &

           If(

           PatternCount ( CERT_LIST ; "S-190 Introduction to Basic Wildland Firefighting" ); "S-190 Introduction to Basic Wildland Firefighting¶"

           ) &

           If(

           PatternCount ( CERT_LIST ; "EVOC Emergency Vehicle Operations Course" ); "EVOC Emergency Vehicle Operations Course¶"

           ) &

           If(

           PatternCount ( CERT_LIST ; "FRA Hazmat Awareness Level Training" ); "FRA Hazmat Awareness Level Training¶"

           ) &

           If(

           PatternCount ( CERT_LIST ; "IS-00100.a Introduction to Incident Command System" ); "IS-00100.a Introduction to Incident Command System¶"

           ) &

           If(

           PatternCount ( CERT_LIST ; "IS-00700.a National Inciden Management System: An Introduction" ); "IS-00700.a National Inciden Management System: An Introduction¶"

           ) &

           If(

           PatternCount ( CERT_LIST ; "IS-00800.b National Response Framework: An Introduction" ); "IS-00800.b National Response Framework: An Introduction¶"

           )&

           If(

           PatternCount ( CERT_LIST ; "IS-00200" ); "IS-00200¶"

           )

            

           see image 4 and 5 in attached file

           I am not a filemaker developer and yet I have to make this work.

           I simply need to add a requirement, the last on the value list above and have it validate correctly.

            

           My understanding of the proper way to read the calculation expressions is  causing me to fail in my effort.

            

           Any help is appreciated.

            

           Thanks !

            

      filemakerIMGS.jpg

        • 1. Re: how to make a check box set validation of list content work.
          philmodjunk

               When you click a check box, the selected value is appended to the list of values already in the field. Each value is separated by a return.

               Thus I do not see the purpose to your calculation. It would seem that:

               This calculation expression:

               CERT_LIST

               Would produce exactly the same results as what you intend with your calculation.

               In fact, I don't see a need for the calculation field at all as you should be able to just put CERT_LIST on your layout formatted with checkboxes and the appropriate value list.

                

          • 2. Re: how to make a check box set validation of list content work.
            eliahoo

                 the user does not select the checkbox:

                 the check boxes are populated by the calculation depending upon the content of the list. The list can contain many things, the chec kboxes are reflective of a subset of the list.

                 The form does work, i am trying to make an additional check box (which i have done) I am having difficulty with the formula that puts the check in the box upon validating that the required certificate(record) is present.

                  

                 thanks :)

            • 3. Re: how to make a check box set validation of list content work.
              philmodjunk
                   

                        the user does not select the checkbox:

                   Correct, but you've indicated that after selecting a value in the drop down list, the user might then make additional changes in what check boxes are selected. Both of the above methods support that option, but you can also lock them out of making direct changes to the check box field as well. And if users are not allowed to refine what check box values are selected, there's an even simpler method that does not set any additional value in any field of your main table, it just displays data from the related table.

                   

                        The form does work, i am trying to make an additional check box (which i have done) I am having difficulty with the formula that puts the check in the box upon validating that the required certificate(record) is present.

                   If you are asking for additional assistance with that, I'll need a more detailed description of what you have set up and where you are having difficulty.

              • 4. Re: how to make a check box set validation of list content work.
                eliahoo

                     the user makes no changes in the check boxes , the user can only add to the list from  a drop down list of selections.(personal educational certifications)

                     the check list evaluates for a subset of the list (required certifications to meet particular standard or qualification level)

                     there can be more than one item on the list that meets the requirement of the check box

                     the check box  represents required elements , 

                     the multi check box control simply validates the list. If the required certification is present it shows a check. 

                     If all the check boxes are present it checks another box in another location on the form.

                      

                     This does work,it was built by someone else who is not longer available  i am simply trying to add a required element, I cannot get the check to appear. i am not sure why.....

                      

                • 5. Re: how to make a check box set validation of list content work.
                  philmodjunk

                       Scratch my last comment! I thought I was reading a different thread than this one. It does not apply here. Sorry for the confusion! blush

                       My original point is that the "content of the list" is a return separated list of values as far as I can see here. Thus you do not appear to need two fields for the same list of values if the only difference is the check box format used on the layout. Additional values that are not part of this "subset of values" simply won't appear in the field once it is formatted with checboxes that use this "subset" value list.

                       However, if you want a field that stores just the values in your check box list with no additional hidden values, this calculation will return just the values in CERT_LIST that are also in the check box field's value list:

                       FilterValues ( CERT_LIST ; ValueListItems ( Get ( FileName ) ; "CheckboxValueListInQuotesGoesHere" )

                       This calculation field can have text selected as the result type and if you select a check box format with your value list for it, you'll get the data presented as selected check boxes, but it will be read only.

                  • 6. Re: how to make a check box set validation of list content work.
                    eliahoo

                         I am interested in alternative methods of solving the problem, but first I would like to understand why this one works and why I cannot validate or "check"  the checkbox i added 

                    • 7. Re: how to make a check box set validation of list content work.
                      philmodjunk

                           The existing calculation works because it builds a return separated list of values which, as I have already pointed out, is exactly the same format used with a check boxes format on a field.

                           I cannot spot any obvious errors in the calculation that you posted. It might take a careful examination of the exact text being entered in the CERT_LIST field to discover why it does not work for you. it could be something as simple (but easy to overlook)  as a case where your calculation might use the letter "O" where your actual value in the field might have a zero digit or vice versa.

                           There is a potential issue when using PatternCount in this manner as it can incorrectly detect the presence of a selected value in some value lists, but the list of values that you appear to be using here does not seem to have that issue.

                           But given that this extremely complex calculation is not needed, it would seem a better use of your time to discard this approach and replace it with a much, much simpler method.

                      • 8. Re: how to make a check box set validation of list content work.
                        eliahoo

                             so i have a list containing L1,L2,L3, L4, L5, L6, L7        i have requirements R1  R2    and L1 satisfies R1 and L2 and L4 satisfy R2

                             R1 and R2 are represented by the check box control array. I need to see the box  checked  if the required list elements are present....

                             the simple solution is?

                        • 9. Re: how to make a check box set validation of list content work.
                          philmodjunk

                               This appears now to be a new problem. This is not what your original calculation attempted to do at all. IN that calculation, exactly the same values where appearing in both lists with one value in list 1 matching to either no value in list 2 or just 1 value in List 1. You have now specified that L1 needs to produce 2 values in R and that L4 needs to produce one of the same two values.

                               While I don't know enough about the design and intended function of your database to be sure, I suspect that what you really need is a join table rather than a list of values in a field. A join table and a list of values can often serve the same purpose in FileMaker, but the join table offers simpler, more flexible ways of working with the lists of values once you move beyond simple data entry selection of the values in the list.

                               Without setting up a join table--as I don't know enough to tell if that's the best approach, and just sticking with lists of values in fields, I'd set up a relationship to a table of R values like this:

                               OriginalTable::L = RValues::L2

                               Then the calculation: List ( RValues::R ) should produce the desired return separated list of values that can be formatted with check boxes to show the selected R values matching to the original L values.

                               Using your L and R example values,  The record in RValues for R2 would have L1<return>L4 as values listed in L2.

                               How this works: When you have a pair of match fields in a relationship that contain return separated values, a record in the first table will match to any record in the related table where at least one listed value in both list fields match.

                          • 10. Re: how to make a check box set validation of list content work.
                            eliahoo

                                 so then:

                                 what is happening in existing script that is bound to the checkbox set is that

                                 CERT_LIST_CHECKS  EVALUATES  if(

                                 PatternCount(CERT_LIST :: "N123"); "N123  RETURN CHAR" meaning it is searching Table Cert_List for "text value" , if found it returns the textvalue entered in the formula producing a list of values that are stored in CERT_LIST CHECKS  ??

                                 how does the checkbox get checked.........

                                  

                                  

                                  

                                  

                            • 11. Re: how to make a check box set validation of list content work.
                              eliahoo

                                   thanks for your patients with my lack of understanding....

                                    

                                   I will review all of this and see if i can get it sorted out....

                              • 12. Re: how to make a check box set validation of list content work.
                                philmodjunk

                                     Take a check box formatted field. Put a copy of the field next to the original and remove the formatting so that the copy is an edit box.

                                     Now click different check boxes in the first copy and note what data appears and disappears in the second copy.

                                     The edit box formatted copy shows you the actual data present in the field.

                                     The calculation that you posted builds the same kind of list: text separated by return characters, that is produced by clicking check boxes in a field's value list. So if you format a field that contains such a list of values with a check boxes format, any check box for a value that matches a value in the list, will show as selected. This is true for a text field where the date was entered by a user or by a script and also for a calculation field--so long as a listed value exactly matches a value in the value list.

                                • 13. Re: how to make a check box set validation of list content work.
                                  philmodjunk

                                       Here's a demo file illustrating what I am describing.

                                       If you go to the Hues layout, you can click any combinations of colors in the colorlist field and you'll see the appropriate primary colors appear in the second check box automatically.

                                  https://dl.dropboxusercontent.com/u/78737945/CheckBoxesToCheckBoxesDemo.fmp12

                                  • 14. Re: how to make a check box set validation of list content work.
                                    eliahoo

                                         PhilModJunk,

                                         Thanks so much for your assistance here.

                                         I got it worked out, due to your clarifications.