2 Replies Latest reply on Oct 11, 2012 10:32 AM by kelpgriffin

    If/Then Clause Script Question


      I have more than 1,000 addresses in my contact management book in FileMaker Pro 11. Under "Contact Details," I have a field titled "Region." I also have a field for City (Address). How do I establish a script such that IF Address City (Field) reads "San Antonio," THEN Region field also reads "San Antonio?" Or will it be easier to dig through each unique file, click the region field, and choose "San Antonio?"

        • 1. Re: If/Then Clause Script Question

          Hello, kelpgriffin.


          I'm going to assume that you want users to be able to type into the Region field (i.e., that options other than "San Antonio" should be available). If that's right, then you can set up an auto-enter calculation in your Manage Database dialog (click on the Region field and choose "Options"). The calculation should look something like this:


               Case ( Address City = "San Antonio" ; "San Antonio" )


          That way, if someone selects "San Antonio" for the City, it'll automatically insert "San Antonio" in the Region.


          If you want to update the existing data, perform a Find for all records where City = "San Antonio". Then use Replace Field Contents (Ctrl / Cmd - =). Set the calculation for the Replace to be:


               table::Address City


          That will cause FileMaker to replace the contents of the Address City field with its current contents. (Huh? What good is that?) Well, it'll cause the auto-enter calculation to trigger, meaning all your "San Antonio" entries in Region will be updated without risking doing any damage to existing data. (Just make sure the cursor is in the Address City field before you hit the Replace.)    




          • 2. Re: If/Then Clause Script Question



            Thank you so much for your help.  Saved me HOURS!