4 Replies Latest reply on Jun 3, 2013 5:17 PM by med

    using the evaluate function

    med

      Title

      using the evaluate function

      Post

           This is the first time I try to use the evaluate function and I guess I do not understand the description of it.

           I am trying to send bulk email and the message for each recipient lookes something like this

           This is to remind you of your ppointment on 5/10/3013 at 6:00pm

           where date and time are stored in table fields (call them table::date and table::time)

           I constructed a global variable $$message  as followes

             "This is to remind you of your appointment on "&table::date&" at "&table::time

           then I try to use evaluate($$message)

           It does not give what I am expecting which is, for every person the message will come up with his own date and time which are stored in the table but instead the message evaluates to ?

           Can somebody please tell me how to do this

        • 1. Re: using the evaluate function
          philmodjunk

               Doesn't look like you need the evaluate function at all.

               Seems like you simply need:

               Set Variable [$$Message ; value: "This is to remind you of your appointment on " & table::date & " at " & table::time ]

          • 2. Re: using the evaluate function
            med

                 I have been toying with this for a whole day and I am not able to acheive what I want.

                 I may not have explained my problem fully.

                 I understand that if I put  the variable

            Set Variable [$$Message ; value: "This is to remind you of your appointment on " & table::date & " at " & table::time ]

                 as the body of the email massage it will re-evaluate for each record. But waht I did not mention is that the massge is changing meaning that the text imbeded between the table fields as well as the fields is user definable and stored in some messages table.

                 So some user will store "This is to remind you of your appointment on " & table::date & " at " & table::time ]

                 and others may store "We would like to remind you of your appointment on " & table::date & " at " & table::time & " with " & table::teachername]

                 So I need my script to accomodate all definitions of the message.

                 This is why I need to use some kind of function to re-evaluate the stored message structure for each record.

                 I appreciate having another look at this and advice what to do.

            • 3. Re: using the evaluate function
              philmodjunk

                   Then the needed syntax for that expression requires more quotes:

              Evaluate ( "\"This is to remind you of your appointment on \" & table::date & "\" at \"" & table::time" )

                   You may find it easier to set up message templates similar to those found in this demo file: https://www.dropbox.com/s/6xw8buafjuohncu/MessageTemplateBuilder.fp7

              • 4. Re: using the evaluate function
                med

                     It finally worked.

                     I can finally relax, thank you.

                     By the way the description of the evaluate function which is written in the online help is far from what you guided me to write I will ignore it.