6 Replies Latest reply on Nov 6, 2012 7:41 AM by comment

    Conditional formatting of a found set member

    alheron

      Good Morning All.

       

      My title says it all really, but here is the scenario. I want to generate a found set, then I want a button to change colour to indicate that it belongs to the found set across several (maybe 20 maximum) records. So in English what I need is something like "If I belong to a found set then I need to turn green, otherwise I need to remain black"

      The solution is for buttons which represent locations on a map. If the location(s) satisfy the criterion set to generate the found set then I want the locations to change colour. Once the found set is discarded then the locations need to return to their normal state. I presume I use use conditional formatting for this, but I'm not sure how to do the 'if I'm a member of a found set' coding to trigger the formatting change.

       

      I'm way out of my comfort zone here (again) so hopefully some kind soul will share some thoughts on this.

       

      Many thanks

       

      Al

       

      BTW, this is using Filemaker Pro 12 Advanced, generating a solution for FM Go 12 on iPads.

        • 1. Re: Conditional formatting of a found set member
          Mike_Mitchell

          Hello, Al.

           

          Your problem statement is, "If I belong to a found set then I need to turn green, otherwise I need to remain black". The question is, whose found set? Are we talking about a single-user solution here, or a multi-user solution?

           

          If it's the former, then I'd question what we're trying to accomplish. A found set is automatically displayed to the current user, so, whatever records the user is looking at is automatically the found set.

           

          If it's the latter, then you have a bit of a conundrum. Are you trying to show user A that record X, Y, and Z are part of user B's current found set? What about showing user A that the record is part of his own found set? (Again, this one is intuitively obvious ... everything a user is currently looking at is part of his current found set.)

           

          A bit more definition of the problem scope would probably help us help you.       

           

          Mike

          • 2. Re: Conditional formatting of a found set member
            comment

            alheron wrote:

             

            I presume I use use conditional formatting for this, but I'm not sure how to do the 'if I'm a member of a found set' coding to trigger the formatting change.

             

            You need to "collect" the found set's values into a global field or variable first. There are various ways to do this, for example by looping among the found records. Once you have a list of all found values, you can test each object for =

             

            not IsEmpty ( FilterValues ( "MyValue" ; $$listOfFoundValues ) )

            • 3. Re: Conditional formatting of a found set member
              alheron

              Hello Mike

               

              Here is more detail on my scenario....

               

              It is a single user solution, designed to display geographical sites on a map.  The sites are normally indicated by small black coloured buttons, if you click on a button it will take you to a record page for that site which lists various criteria of the site.  What we need is to select a few criteria with an 'AND' search which creates the found set.  Once the found set is created we wish to change the colour of the button which relates to any member of the found set to green to differentiate them on the map display from all the other non-found sites, I figured conditional formatting was the way to go with this but can't figure out the means of linking the conditional format to the members of the found set.  I can generate my found sets with, say, sites in region A that have electricity and water but no cell coverage easily, but have no way to show these sites on the map.

               

              Not sure if that makes it any clearer...

               

              Thanks

               

              Al

              • 4. Re: Conditional formatting of a found set member
                alheron

                Hi Michael

                 

                This is what I was afraid of, it seems to get more complicated with leaps and bounds.  I'll try to use looping to collect my records, but I think I need to do some more reading first!

                 

                Thanks

                 

                Al

                • 5. Re: Conditional formatting of a found set member
                  Mike_Mitchell

                  Al -

                   

                  Another possible solution (in addition to looping) is to use a custom function to collect the values. Here's one example:

                   

                       http://www.briandunning.com/cf/439.

                   

                  Mike

                  • 6. Re: Conditional formatting of a found set member
                    comment

                    alheron wrote:

                     

                    What we need is to select a few criteria with an 'AND' search which creates the found set. 

                     

                    Couldn't you select the same criteria to establish a related set?

                     

                     

                    alheron wrote:

                     

                    it seems to get more complicated with leaps and bounds.

                     

                    Looping though the found set is not that complicated, esp. if you already have a script running anyway.