8 Replies Latest reply on Sep 19, 2016 2:30 AM by Mike_Mitchell

    ValueListItems issue / conditional selection problem

    phillegg

      Hi Filemaker Community

       

      I've been banging my head against the wall for a few days now and would like to ask for some expert advice on an issue of 'conditional selection'

       

      In the attached file, when you open it up, it shows the Data Entry layout. On this layout is a bunch of radio buttons 5 fields down called 'Media Type' that allow selection of various media (Radio, Press, TV & Live Bookings)

       

      If you select 'Radio', when you then click on the drop-down field 'Activity' (3 fields further down), you get a selection of options (defined by the Value List 'Summary Activity List Radio') and if you select 'Press' you get a selection of options (defined by the Value List 'Summary Activity List Press')

       

      This worked well for a while, whilst I had only Press & Radio options. However, I have recently added 2 additional radio buttons: "TV" and "Live Bookings" to the 'Media Type' field, but these new buttons do not show their respective lists ('Summary Activity List TV' & 'Summary Activity List Live Bookings') when the drop down field 'Activity' is clicked on.

       

      The process that allows the drop-down lists to show for each option of the 'Media Type' field is as follows . . . .

       

      When clicking on 'Activity' the field looks at the Value List 'Summary Activity' which points towards the field 'Contacts Main::ActivityConditional (related values only)' that points to 'Include only related values starting from: Media Type'.

       

      The 'ActivityConditional' field has the following code in it:

       

      Case (  Media Type = "Radio" ; ValueListItems ( $fileName ; "Summary Activity List Radio" );

                 Media Type = "Press" ;  ValueListItems ( $fileName ; "Summary Activity List Press" );

                 Media Type = "TV" ; ValueListItems ( $fileName ; "Summary Activity List TV" );

                 Media Type = "Live Bookings" ; ValueListItems ( $fileName ; "Summary Activity List Live Bookings" );

                 "" )

      I have just added the additional the 2 lines for 'TV' & 'Live Bookings' but cannot see any reason why the the respective lists do not show up for these new options.

       

      I have attached the actual file so you can observe the issue for real and would very much appreciate if someone could let me know how to resolve my problem here and get all 4 options in the 'Media Type' field to display their relevant Activity List.


      Many thanks in advance for you help with this issue

       

      Phil

        • 1. Re: ValueListItems issue / conditional selection problem
          Mike_Mitchell

          Get rid of the "related values only." Use all values instead. There's no need for related values, since your value lists are custom anyway.

          • 2. Re: ValueListItems issue / conditional selection problem
            Mike_Mitchell

            Oh, for some further explanation: You only have two media types in the Media Types table. That's why there are no related values.

            1 of 1 people found this helpful
            • 3. Re: ValueListItems issue / conditional selection problem
              phillegg

              Hi Mike

               

              Thanks for getting back to me.

               

              In response to your reply saying "Oh, for some further explanation: You only have two media types in the Media Types table. That's why there are no related values."

               

              This indeed makes sense and would explain why Radio & Press are working but not the others. However, I'm not sure how to look at the 'Media Type' table that you mention in your reply?

               

              It seem to me (I didn't build the solution, just editing it) that the field 'Media Type' take its values from value list 'Media Type 2' which has all 4 values in it (Press, Radio, TV & Live Bookings). I'd appreciate if you could explain what you mean by "you only have two media types in the Media Types table"? i.e. where did you see only 2 values?

               

              Many thanks


              Phil

              • 4. Re: ValueListItems issue / conditional selection problem
                Mike_Mitchell

                Go to the Media Type layout. That's the table from which the relationship is based. There are only two records. In order for it to work as originally designed, you have to have a record for each possible value. Otherwise, there's no related record and therefore no values.

                 

                But again, it's an unnecessary complication. The values in the value lists are fixed, so there's no point in using related values.

                1 of 1 people found this helpful
                • 5. Re: ValueListItems issue / conditional selection problem
                  phillegg

                  Hi Mike

                   

                  Ahhhh I see, I was seeing the field 'Media Type' in the Main Contacts table without realising there's an actual table called 'Media Type' that contains the values as well (and that's what it looks up, when evaluating the conditional function)

                   

                  Many thanks for solving this for me - much appreciated.

                   

                  One other point whilst I'm here. . . . I tried removing the 'related values only' as you suggested in your previous email but that meant that ALL list options showed up for each Media Type which is not what I was looking to do - so in fact the 'related values only' (set to Media Type) option is actually necessary.

                   

                  I'm relatively new to the details of solution development so sorry if I came across a bit dumb. However I've learnt a lot through this conversation so many thanks

                   

                  All the best

                   

                  Phil

                  • 6. Re: ValueListItems issue / conditional selection problem
                    Mike_Mitchell

                    Yes, since the value list is based on the value of the calculation field in the main table, it would return all values. My bad. I'm not used to seeing things structured this way.

                     

                    Normally, if you wanted to build a constrained value list like this, you would have a table of values for the list, along with the discrimination field (in this case, Media Type). Then, you make a join from the Media Type field in the main table to the Media Type field in the value list table. That way, you don't need all the extra value lists, and you can update the values in the list merely by changing the data in the value items table. Might be something to consider.

                    • 7. Re: ValueListItems issue / conditional selection problem
                      phillegg

                      Hi Mike

                       

                      Thanks a lot for you suggestion of a cleaner way to do this. Much appreciated.

                       

                      One thing I'd appreciate more clarity on: How do you link to the 'discrimination field' in order to make the correct value list appear for each option?

                       

                      A really nice, and much cleaner way of doing things - thanks.

                       

                      Phil