11 Replies Latest reply on Jul 13, 2012 10:03 AM by DavidGroos

    Conditional formatting only shows on first rep of repeating text field

    DavidGroos

      Title

      Conditional formatting only shows on first rep of repeating text field

      Post

      Hi Folks,

      I'm wanting all (2) repeating fields to display the conditional formatting defined for it.  However, only the first rep is shown conditionally formatted.  I've defined a formula for the conditional formatting.  I've looked high and low to no satisfaction.  Help please!

      Thanks,

      David G

        • 1. Re: Conditional formatting only shows on first rep of repeating text field
          philmodjunk

          Please share the formula you have used.

          • 2. Re: Conditional formatting only shows on first rep of repeating text field
            DavidGroos

            Formula is:

            If ( wp_2_comments::TypeOfEpistemicGoal = "Question" ; 1 ; 0 )

            text color then = none

            fill color then = none

             

            So, when TypeOfEpistemicGoal = "Question" then the first rep is blank (no color in text or fill) as it should, however, in the second rep the text and fill color are their default colors (blue in this case).  I would want both reps to have the same formatting based on the condition of the other field. 

            Thanks PhilModJunk,

            David G

            • 3. Re: Conditional formatting only shows on first rep of repeating text field
              philmodjunk

              BTW, wp_2_comments::TypeOfEpistemicGoal = "Question"

              will evaluate the same as when using If ( wp_2_comments::TypeOfEpistemicGoal = "Question" ; 1 ; 0 ). Wink

              What version of FileMaker are you using?

              I think you may need to reverse the logic here to format the field with no color and use conditional formatting to specify color. Any chance that your cursor is in the first repetition at the time? That procuces appearence changes that may make it look like it is working for the first repetition.

              That's what was needed in FMP 11 and earlier anyway. Haven't tried that in FMP 12.

              Try:

              If ( wp_2_comments::TypeOfEpistemicGoal = "Question" ; 0 ; 1 )

              Format the field with no color options in layout mode and use the conditional format expression to specify color.

              Now to do a little testing of my own in FMP 12--almost never use repeating fields anymore...

              • 4. Re: Conditional formatting only shows on first rep of repeating text field
                philmodjunk

                Just finished downloading FileMaker 12v2 and used this as my first test of the bug fix download.

                I can indeed specify "no color" for the fill and text and it works and for all repetitions.

                I used the number 1 -- which will always evaluate as true

                for my formatting expression.

                I then tried applying text and fill formats that added color and then tried it with formats that removed text and fill color.

                Both worked correctly and for all repetitions of the field.

                • 5. Re: Conditional formatting only shows on first rep of repeating text field
                  DavidGroos

                  Hi PhilModJunk!

                  Again, thank you so much for taking the time to help me on this.  I'm using the FMP 12 v.1 trial (waiting for my software to come in the mail!).  I did as you suggested to make the background blank in the layout, then conditionally formatted the fields so that they would have a particular color when a particular text had been entered in the referenced field, using the simpler fieldname = "Question" formula you pointed out.

                  Interestingly, while I got the same results (if the referenced field said "Question" then only the first rep would colorize and the second rep stayed blank.  However, this wasn't a problem and is actually good now that the background was white by default!  It was also good in that I have now made the field containing "Question" (or not) data into a repeating field.  So now, the data I put in that second rep determins the color of the second rep in the conditionally-colored field!  So, all good for my use case now. 

                  Maybe if I made the "Question" field into a non-repeating field, then things would work how I had wanted them to work originally and how you got them to work.

                  Thanks and Have a great afternoon (assuming you're in a similar timezone!),

                  David G.

                  • 6. Re: Conditional formatting only shows on first rep of repeating text field
                    philmodjunk

                    Don't know about that. My tests were with a repeating field so I couldn't reproduce what you are describing here.

                    • 7. Re: Conditional formatting only shows on first rep of repeating text field
                      DavidGroos

                      Thanks for experimenting!  You inspired me to reach to the bottom of this and so I made a new layout with 5 new fields, making sure to keep one of them a non-rep field and the other 4 were 4-rep fields.

                      I used 2 'source' fields--the one I put the value in which was evaluated and therefore determined the conditions of the conditional fields.  And it turns out that if the source field has reps, and the conditional field has reps, then the coloration of conditional fields refers to the specific rep in the source field, BUT if the source field doesn't have reps, then ALL reps of the conditional field are colored.

                      Again, thanks PhilModJunk for your support and I hope the following image shows the above points better than I could say it!

                      David G

                      • 8. Re: Conditional formatting only shows on first rep of repeating text field
                        philmodjunk

                        Cool! Persistance has paid off!

                        Note: Repeating fields are rarely a good design for your solution. You may have one of those "special cases" where repeating fields actually make sense, but in most cases, a related table viewed via a portal works out better for your solution.

                        • 9. Re: Conditional formatting only shows on first rep of repeating text field
                          DavidGroos

                          Yes, I noticed your comment yesterday where you said you rarely use repeating fields anymore and it piqued my interest.  And, in the process of problem solving I saw some comments which mainly disparaged repeating fields.  I'm using FMP as I analyze the dialogs in some 200 comments from a wordpress blogging system, with one record per comment.  However, sometimes a comment will have 2 distinct ideas and I need to parse that comment into the 2 parts, and that's when I make use of the repeating fields.  However, in 95% of the posts I don't need to parse the comment.

                          I'm not sure what constitutes a valid use of repeating fields and would like to learn more now instead of later!  I'd appreciate any recommended links to read on the subject.

                          Thanks,

                          David G

                          • 10. Re: Conditional formatting only shows on first rep of repeating text field
                            philmodjunk

                            Once upon a time, FileMaker was a "flat file" system. There were NO related tables possible. The only way you could associate multiple identical items to a single record was to define a repeating field with a repetition for each item. This was back in FileMaker 2.5. Then FileMaker 3 came out and it was now possible to establish related tables of information and portals so that we can display entire sets of related records on the layout of the related "parent" table.

                            This is a much more flexible approach as you are no longer limited to a specific number of repetitions and you can produce reports on a layout based on the related table that pulls data from the parent.

                            But FileMaker retained repeating fields and the functions designed to be used with them so that existing solutions still worked when the user upgraded. Repeating fields have been a part of FileMaker ever since but FileMaker's increasingly sophisticated tools for working with related records makes repeating fields a seldom used design feature. Some developers use a repeating field as a special key in relationships where the value in any one repetition can match to any one value on the other side of the relationship--a kind of "OR" type relationship, but others, such as myself don't even do that as we can get the same results with a text field of return separated values and once again aren't limited to a set number of repetitions.

                            The other argument for repeating fields is that it's easy to put a horizontal row of repetions into a list view, table view, or portal and give the entire set of repetitions identical formatting. This has some utility within a portal, but a list view can be used with a series of one row portals to get the same effect--with more work and thus still maintain the flexibility of using related records in place of repetiitons.

                            In your case, a portal with two related records might well serve as a better approach. For one thing, if the need ever arose for more than two "ideas" to be logged, adding that third idea becomes as simple as adding one more record in a portal as apposed to redefining your field to store an additional repetition. Also imagine creating a report that lists each "idea" once as a sub heading with the comments linked to it listed under the sub heading. THis is easily done with a related table--not so easily if the idea is entered into repetitions of a repeating field.

                            • 11. Re: Conditional formatting only shows on first rep of repeating text field
                              DavidGroos

                              Interesting--Maybe I'll start to rethink-transform this database as I've just started to analyze this data.  I really appreciate your history lesson and analysis of these tools.  I used to do a huge amount of work with portals--that was in FMP 4 then 5.  Seems like I started with FMP 3 but that's getting foggy...

                              Thanks for your time and expertise,

                              David G.