5 Replies Latest reply on Nov 26, 2016 1:07 PM by philmodjunk

    How can I slide/remove/hide empty fields AND their labels?

    fleamo

      Say I have a dataset like this:

       

      NameCountryAge
      FredCanada24
      Bill16
      SamEngland
      EricWales32

       

       

      What I'd like to achieve is something like this:

       

      Name Fred

      Country Canada

       

      Name Bill

      Age 16

       

      Name Sam

      Country England

       

      Name Eric

      Country Wales

      Age 32

       

      Essentially, I want to ignore empty fields (which I've had *some* success doing using Slide Up), but also the corresponding labels (which have different formatting applied to them).

       

      In practice, my database has dozens of fields, any of which could be blank (and therefore must be ignored), so any solution would need to accommodate that level of complexity.

       

      BONUS QUESTION: My ideal layout is organized into two columns. When the first column gets filled, additional fields bleed over to the top of the the second column and continue from there.

        • 1. Re: How can I slide/remove/hide empty fields AND their labels?
          Johan Hedman

          Looks like you are showing a Table View. There you can not use Hide Object. But if you are on a regular layout you can use Hide Object to hide label and field if there is no information. But think twice before you do that. If you hide a field, you can not enter information into it either.

          Skärmavbild 2016-11-24 kl. 08.55.04.png

          • 2. Re: How can I slide/remove/hide empty fields AND their labels?
            Mike_Mitchell

            Hiding won't help you here, and, as you've discovered, field labels don't disappear using the sliding feature. What you'd need to do is create calculation fields that concatenate the field label together with the value, like this:

             

                 Case ( not IsEmpty ( Name ) ; TextStyleAdd ( "Name" ; Bold ) & " " & Name ; "" )

             

            Then, use these calculation fields on your report (with sliding enabled).

             

            To answer your second question, set your layout to print in 2 columns. This is done in the Layout Setup dialog:

             

            Screen Shot 2016-11-24 at 7.14.53 AM.png

             

            HTH

             

            Mike

            1 of 1 people found this helpful
            • 3. Re: How can I slide/remove/hide empty fields AND their labels?
              fleamo

              Thanks Mike. I had thought about concatenating the labels into fields, but I was hoping there was a more streamlined, elegant solution.

               

              Regarding the columns issue, maybe I wasn't clear. This is what I want to achieve on a per-record basis.

               

              So if I have a record with only a few filled out fields it'd look like:

               

              Name Adam

              Age 30

              Hobbies snowboarding

               

               

               

              But if that same record had many more fields, my layout would look like this:

               

               

              Name Adam

              Age 30

              Country Canada

              Hobbies Snowboarding

              History None

              Contact Phone

               

               

              Similar to how you might set up columns in a Word document, where the bottom of one column connects to the top of the next column, and content that doesn't fit in the first column flows into the second.

              • 4. Re: How can I slide/remove/hide empty fields AND their labels?
                Mike_Mitchell

                You'll need to have a single calculation field for all the values in a list. Use the same methodology as before:

                 

                List (

                 

                     Case ( not IsEmpty ( Name ) ; TextStyleAdd ( "Name" ; Bold ) & " " & Name ) ;

                     Case ( not IsEmpty ( Age ) ; TextStyleAdd ( "Age" ; Bold ) & " " & Age ) ;

                     Case ( not IsEmpty ( Country ) ; TextStyleAdd ( "Country" ; Bold ) & " " & Country ) ;

                     Case ( not IsEmpty ( Hobbies ) ; TextStyleAdd ( "Hobbies" ; Bold ) & " " & Hobbies ) ;

                 

                )

                 

                Now create a second calculation field:

                 

                     RightValues ( contentList ; ValueCount ( contentList ) - 3 )

                 

                Use contentList for the left column, and this field for the right column (assuming you want exactly three values to be the maximum).

                 

                The limitation here is that you have to choose ahead of time how many values should be allowed.

                 

                But this sort of multi-column text flowing is not a feature of FileMaker natively. It's not a word processor; it's a database.

                • 5. Re: How can I slide/remove/hide empty fields AND their labels?
                  philmodjunk

                  If this is a form view or list view layout. Use Hide Object When on the field label text to hide them when the corresponding field is empty. Then set the label to slide up. Sliding up works with hidden layout objects just like empty fields.

                  1 of 1 people found this helpful