7 Replies Latest reply on Feb 20, 2017 10:10 AM by philmodjunk

    Evaluate function!

    aliabbassipro

      Hi.

      After Lot of searching, I don't understand what is evaluate function.

      please give me examples about this function or if anyone has learning video please give it to me.

       

      thank you for helping.

        • 1. Re: Evaluate function!
          PeterDoern

          Matt Petrowsky's video Dynamic Calculations - Merge Fields in Email and Custom Coloring techniques - ISO FileMaker Magazine should be a good introduction to Evaluate.

           

          Two recommendations:

          1. master FileMaker fundamentals before you start using Evaluate.

          2. Don't just read about functions, play with them in FileMaker. Most of what I know about FileMaker functions, script steps, controls and so on came from actually using them, not reading about them or watching videos.

          • 2. Re: Evaluate function!
            aliabbassipro

            I want to know that when we use this function?

            • 3. Re: Evaluate function!
              PeterDoern

              aliabbassipro wrote:

               

              I want to know that when we use this function?

              Short answer: when it's appropriate. It's not a function you put into your file just for the sake of using it. Watch the video I linked to for a demonstration of when it is appropriate.

              • 4. Re: Evaluate function!
                beverly

                Text field "A" contains:

                2+3

                 

                Function calculation, with result of number type:

                Evaluate( table::A )

                returns:

                5

                 

                First follow the examples in the help for the topic. Then search 'FileMaker evaluate function' (here and elsewhere to see if there are  other examples or articles). Then come back here if there are additional questions.

                 

                Sent from miPhone

                1 of 1 people found this helpful
                • 5. Re: Evaluate function!
                  Vincent_L

                  Basically Evaluates excute text as if it was code. So you programmatically write code and have it executed.

                   

                   

                  So if you write Evalluate ("Upper(\"gh\"")") it will output GH (notice that I had to protext the quote with \)

                   

                  The most usage case is certainly to create variables programmatically with a lte statement

                   

                  Evaluate ("let($myVar=\"something\";\"\")") will create the variable $myVar containing something

                   

                  You can even put code in a field record, and then have a script evaluate that code that's stored in a file record

                   

                  That's very powerful and if you need to create generic code that would work in many situation you'll probabbly haveto use it

                  • 6. Re: Evaluate function!
                    coherentkris

                    I'm with everyone here.

                    It's valuable to learn because it can solve problems that no other function can.. such as giving the user the ability to write calculations without exposing the manage database functionality.

                    Evaluate ( the_field )..expose the_field on a layout and watch the magic.

                    I would not use evaluate because it was just there. I have to have a specific reason to use it that can not be solved gracefully any other way.

                    • 7. Re: Evaluate function!
                      philmodjunk

                      There is an important difference between an expression evaluated by the evaluate function and the same expression entered into the calculation editor.

                       

                      An expression in the calculation editor references fields by their internal ID codes assigned by FileMaker at the time you define the field. Evaluate references the same field by the name you give it.

                       

                      If you later rename the field, Evaluate can then fail to work but the same expression in the calculation editor will simply use those ID codes to correctly reference the data.

                       

                      Thus, while very useful, it must be used with care. Sometimes functions such as getfieldname can be used to supply Evaluate with the needed names without  locking your solution to specific names. Other times, you should carefully document the fields, tables, and table occurrences that will break something if renamed.

                       

                      Other functions (and script step) that reference data by name instead of by ID: 

                      getField

                      ExecuteSQL

                      Set Field by Name

                      2 of 2 people found this helpful