8 Replies Latest reply on Feb 21, 2014 1:04 PM by gsharkeyrgi

    Variables

    gsharkeyrgi

      Title

      Variables

      Post

           I am having difficulty with the basic use of variables. I'm trying to learn how not to use copy and paste to perform finds.

           In the test file shown in the screen grab. I just want to find the values based on the DataToFind field.

      Step1.png

        • 1. Re: Variables
          philmodjunk

               There are two ways to use the value in a variable in a scripted find. With stored find criteria (not my first choice), you can refer directly to the variable. You cannot, however combine the value in the variable with other terms such as < to create an expression.

               You can also do this (my first choice):

               Set Variable [$Datatofind ; value: test::datatofind ]
               Enter Find mode []
               Set field [test::datatofind ; $DatatoFind ]
               Set Error Capture [on]
               Perform Find[]

               Think of Set variable as the step to use in place of copy and Set field as the step to use in place of Paste.

               For more examples of scripted finds: Scripted Find Examples

          • 2. Re: Variables
            gsharkeyrgi

                 Thanks for the reply. Once I figured out how to place the information correctly into the Set field step it script works as it should.

                 Now that I've accomplished that part, can you teach me how to "List" the data from all the records in a found set. My end goal is to

                 email a order list to our distributor (Item, qty, sku...) I was able to get the data from the first record only.

            • 3. Re: Variables
              philmodjunk

                   To list all the data from the found set, use either list or table view.

              • 4. Re: Variables
                gsharkeyrgi

                     I can view the data. I'm trying to "use" all the data from each record to populate an email. For Example

                     Record 1

                     Item - Tires  Qty - 4  Sku - T78-16

                     Record 2

                     Item - Wipers  Qty - 2  Sku - WSH-W-14

                     Record 3

                     Item - Luge Nuts  Qty - 20  Sku - LN-2785

                • 5. Re: Variables
                  philmodjunk

                       What version of FileMaker are you using? There's a nifty summary field you can use if you have FileMaker 13.

                  • 6. Re: Variables
                    gsharkeyrgi

                         I have 13 Advanced

                    • 7. Re: Variables
                      philmodjunk

                           Note: In all versions of fileMaker, it may be possible to set up a relationship that matches to these records and then there are wasy to use the List function to get a list of data from these records.

                           In FileMaker 12 and 13, ExecuteSQL might be used.

                           In FIleMaker 13, there's also a new kind of summary field, the "list of" summary field that produces a list of the data in a specified field with a return separating each item. To use it in your case, you can define a calculation field that combines the data that you want from a single record in a single field using the & operator to concatenate the data and then you can use this new summary field to "list" that calculation field.

                      • 8. Re: Variables
                        gsharkeyrgi

                             PhilModJunk, Thanks for your help, I got it working using the New "list summary field".