1 Reply Latest reply on Apr 9, 2014 6:03 AM by philmodjunk

    Substitute command and repeating fields

    WF7A

      Title

      Substitute command and repeating fields

      Post

           Howdy, howdy:

           I'm coding a script and am trying to use the Substitute command to replace data in a repeating field's cells and just can't nail the command for it while in the Replace Field Contents window. This is what doesn't work:

           Substitute ( GetRepetition ( Alpha ; 2 ) ; alpha2)

           …and...

           Substitute ( Alpha[2] ) ; alpha2 )

            

           How should I phrase the equation?

            

           (What I'm doing is taking eight separate fields' data (alpha1, alpha, alpha3 … alpha8) and pushing each one's contents into its respective place in a repeating field, alpha.)

           Thanks,

           Rich

        • 1. Re: Substitute command and repeating fields
          philmodjunk

               Substitute is not intended for that use. If you were to look it up in Help, you'd find that it is intended to take text found in one field and replace it with different text. It can take "This is a test" and replace "test" with "job" to produce "this is a job".

               Set field can move data from the field to a repetition in a repeating field.

               But I advise against using repeating fields! They were useful back in FileMaker 2.5 when FileMaker was still a flat file system, but since FileMaker 3, using a related table of records with one record in place of each repetition is almost always the better, more flexible option.

               I recommend setting up a related table and using a portal (Or row of one row portals) on your layout in place of the repeating field.