6 Replies Latest reply on Aug 14, 2014 6:09 AM by philmodjunk

    GetField returns null



      GetField returns null


      FileMaker Go



      Operating system version

      iOS 6.1.3

      Description of the issue

      GetField returns a null value instead of the value of the TableOccurrence::FieldName text named in the parameter.

      Steps to reproduce the problem

      Create a script that uses GetField in a script step such as Set Variable, Set Field By Name or Show Custom Dialog.
      When the script is executed on FileMaker Pro. The quoted text or text expression used as a parameter to produce a tableoccurrence::FieldName results in the value of that named field being returned. Perform the same script in FM Go and a null value is returned.

      Expected result

      That the value of the named field is returned--as it does in FM Pro.

      Actual result

      No value is returned and script step fails to execute correctly as a result.


      Don't use getField to refer to the contents of a field. Create a very large number of scripts--each with direct references to a different field instead of a single script with an indirect reference to a value passed as a script parameter.

        • 1. Re: GetField returns null


               I did come up with an awkward work around--If-Else IF blocks of script that use set field instead of set field by name to modify fields--feels like I'm back designing in FIleMaker 3 when I do it though as I have add another block each time I want to use the same script and button with a different field. It does save having multiple scripts where the only difference is the referenced field, however.

          • 2. Re: GetField returns null


                 Thank you for the post. 


                 Are the two referenced fields in the same table or related tables? 


                 In my test, Field A contains "Field B" and Field B contains "Test" and I used the following script:


                 Set Variable: [$X; Value: GetField( Table::Field A )]

                 Show Custom Dialog [$X; $X]


                 I get the same result in FileMaker Pro 12.0v4 and FileMaker Go 12.0v7. Running the script from either platform returns "Test" and "Test" for the title and the body of the dialog window; however, if Field A contains the name of a field in an unrelated table, then I return <null> from both FileMaker Pro 12.0v4 and FileMaker Go 12.0v7.


                 FileMaker, Inc.

            • 3. Re: GetField returns null

                   Same table, fully qualified references using Table Occurrence Name::FIeld Name format--script works as expected in Pro but not in GO. I use GetFIeldName to pass this info as a script parameter so that the same script with different button/parameter pairs could modify different fields in different tables.

                   I'll have to test without the table occurrence name--which is not an issue in Pro to see if that works in GO. And I thought I verified that GetFIeldName is working, but I'll check that also.

              • 4. Re: GetField returns null

                     Just tried to set up a demo file that I can share and now it works perfectly. Should have tested in a brand new file before posting the report.blush

                     Now back to the original file to see if I can spot why it didn't work in it...angry

                • 5. Re: GetField returns null

                       TSFalcon and PhilModJunk,

                       Just wanted to let you know that I ran into this bug yesterday. Perplexing experience to say the least. The code in question worked great on Pro, but didn't on Go, because GetField( ) was returning blank. Even more interesting is that GetField( ) worked fine in a different FileMaker file on that same Go client. In other words, GetField( ) only stopped working in one particular file.

                       I had a colleague of mine open the file in question while I was having the problem and GetField( ) worked fine for him on his Go client. So the problem appears to be isolated to a particular file on a particular Go client.

                       The only way to fix the problem was to restart FileMaker Go on my iPhone (aka double tap the home button and swipe FileMaker Go off the screen). Worked fine after that.

                       If it helps: the file was hosted on FileMaker Server 13.0v3, but that didn't seem to matter. I closed the file via the Admin Console and reopened it. Problem still persisted. I downloaded a local copy of the file via the Admin Console, got the local copy onto my iPhone, opened the local copy, but the problem still persisted. Only restarting FileMaker Go itself fixed the problem.

                       Other relevant environment info: FileMaker Go 13.0v4 on iOS 7.1.2, FileMaker Pro Advanced 13.0v3 on Mac OS 10.9.4

                  • 6. Re: GetField returns null

                         Please see my more recent post on this subject for both more info and a script that can detect this issue and prompt the user to restart the App: GetField returns null in FileMaker Go