9 Replies Latest reply on Jan 7, 2016 8:26 AM by TSGal

    Curiosity with List ()

    Agnès

      Hi FileMaker team,

       

      I would like to anderstand this :

       

      List (  FieldID ; GetNthRecord ( FieldID ; Get ( RecordNumber ) + 1 ) )

       

      And

       

      FieldID & ¶ & GetNthRecord ( FieldID ; Get ( RecordNumber ) + 1 )

       

      with FieldID contain serial number ID_001 ; ID_002 ; ID_003 ; ID_00n

       

      the first calc return ( not correct )

      ID_001¶ID_001

      the second return ( correct )

      ID_001¶ID_002

       

      Why this difference ?

       

      Thanks

       

      Agnès

        • 1. Re: Curiosity with List ()
          Benjamin Fehr

          I'm not sure if I'm wrong but I'm irritated about the mix of

          - 'FieldID', presumably a unique serial-number with a record, based on AutoEnterCalc

          AND

          - 'RecordNumber', which to my understanding is representing the order of a record within a portal OR a FoundSet

           

          Thereby, you would be mixing two different kind of values?

          With your example, could it be that the Record in Focus is with FieldID = 1 ?

          This would explain why you get a correct result with your second example.

          • 2. Re: Curiosity with List ()
            Agnès

            Hello,

             

            with a foundset, not with portal.

             

            The mix is just to see the problem with list(... ; ... ; ... )

             

            "With your example, could it be that the Record in Focus is with FieldID = 1 ?"

            no focus ( layout in mode list for seen the 3 field )

             

            record 1 result with list is ID_001¶ID_001 and with &¶ & is ID_001¶ID_002

            record 2 result with list is ID_002¶ID_002 and with &¶ & is ID_002¶ID_003

            record 3 result with list is ID_003¶ID_003 and with &¶ & is ID_003¶ID_004

            (...)

            record n result with list is ID_00n1¶ID_00n1 and with &¶ & is ID_00n1¶ID_00n+1

             

            it is just to be careful about using List ( Record_n_Exp_1 ; Record_n_Exp_2 ; Record_n_Calc_1 ; ... ) with Expression / calc

            ( and not List ( related::Field ) )


            I mix two and more different kind of values, I test more, but I do not want to irritate anyone


            Agnès

            • 3. Re: Curiosity with List ()
              BeatriceBeaubien

              Very interesting observation, Agnès. I don't have an explanation, nor have I stumbled on it, and I agree it is hard to cast this as expected behaviour.

               

              Best wishes,

               

              Beatrice

               

              On Dec 28, 2015, at 10:46, Agnès <noreply@filemaker.com> wrote

               

                                        

              Curiosity with List ()

              reply from Agnès in Report a Product Issue - View the full discussion

               

              Hello,

               

               

              with a foundset, not with portal.

               

               

              The mix is just to see the problem with list(... ; ... ; ... )

               

               

              "With your example, could it be that the Record in Focus is with FieldID = 1 ?"

               

              no focus ( layout in mode list for seen the 3 field )

               

               

              record 1 result with list is ID_001¶ID_001 and with &¶ & is ID_001¶ID_002

               

              record 2 result with list is ID_002¶ID_002 and with &¶ & is ID_002¶ID_003

               

              record 3 result with list is ID_003¶ID_003 and with &¶ & is ID_003¶ID_004

               

              (...)

               

              record n result with list is ID_00n1¶ID_00n1 and with &¶ & is ID_00n1¶ID_00n+1

               

               

              it is just to be careful about using List ( Record_n_Exp_1 ; Record_n_Exp_2 ; Record_n_Calc_1 ; ... ) with Expression / calc

               

              ( and not List ( related::Field ) )

               

               

               

              I mix two and more different kind of values, I test more, but I do not want to irritate anyone

               

               

               

              Agnès

               

              • 4. Re: Curiosity with List ()
                FredoMkb

                Hi everyone,

                 

                Small hack with an addition or concatenation, depending on the type of result we would like:

                 

                List ( FieldID ; 0 + GetNthRecord ( FieldID ; Get ( RecordNumber ) + 1 ) )

                Or

                List ( FieldID ; "" & GetNthRecord ( FieldID ; Get ( RecordNumber ) + 1 ) )

                 

                Apparently, a simple addtion, or concatenation, seem to "force" the "list()" function to make the job correctly, this confirms, in any case, the curious behavior of the "list()" in this case.

                 

                Fredo

                 

                 

                • 5. Re: Curiosity with List ()
                  Benjamin Fehr

                  FredoMkb

                  My Math-Teacher would give you only half the points, since the result is correct, but you couldn't explain why

                  Maybe TS can explain all the circumstances with this case, - dependencies, when this gets evaluated, on which focus.

                  Or maybe it takes a Draco-Expert to answer this.

                  • 6. Re: Curiosity with List ()
                    FredoMkb

                    @efficientbizz

                     

                    Honestly, I do not know why it behaves this way, after further testing, I think the "GetNthRecord()" also has some responsibility in this curious result, for example, this code dont work:

                     

                    Let (

                      _num = GetNthRecord ( IdField ; Get ( RecordNumber ) + 1) )

                    ;

                      List ( IdField ; _num )

                    )

                     

                    In this case, we must also force the "GetNthRecord()" with something for her to work correctly (addition, concatenation, or place it in any other function) ... but, frankly, I dont understand why, sorry.

                    • 7. Re: Curiosity with List ()
                      Agnès

                      Hmmm, there is nothing to understand, in this case, curiosity = bug list ()

                       

                      Fredo, change your calc with result =    _num & " " & List ( IdField ; _num )

                      and you can see :

                      ID_003 ID_002¶ID_002

                       

                      GetNth is ok, Let too... Stay List

                       

                      Best wishes !

                       

                      Agnès

                       

                       

                      • 8. Re: Curiosity with List ()
                        Benjamin Fehr

                        It's the $250'000.- question and you still have your "phone-a-friend" option. Would you like to call

                        apaulsen ?

                         

                         

                        • 9. Re: Curiosity with List ()
                          TSGal

                          Agnès:

                           

                          Thank you for your posts.

                           

                          Our Development and Testing departments are aware of this issue.  In essence, GetNthRecord will always return the value of the current record when inside the List function unless an empty string is appended to the beginning.

                           

                          Another customer on the Community has also run into this issue:   

                          GetNthRecord Unreliable in custom function

                           

                          I have attached your post to the original report.  When more information becomes available, I will post again.

                           

                          TSGal

                          FileMaker, Inc.