2 Replies Latest reply on Apr 6, 2015 9:38 AM by philmodjunk

    Gathering a list of variables

    themactech.

      Title

      Gathering a list of variables

      Post

      Hello AllI'm working on a script this morning to go through each Supervisor's employees, calculate the time they entered for the week and send that supervisor an email with the employee's name and their hours. I could send a separate email for each employee but one email per Supervisor is better. 

      my variables would simply be $employee and $hours


      As I go through each employee record and hours what's the proper way to gather those variables into a list then when the email is created drop that list into the body of the email. 

      Thanks

      Clay

       

        • 1. Re: Gathering a list of variables
          themactech.

          so this is what I came up with... 

          basically the script searches for employees by Supervisor. The resulting found count uses this variable as it goes through each record.

          Let ( $list = $list & ¶ & Employees::c_Full NameFIRST & " - "  & emp_TIMESHEETS::s_TotalHours;$list)

          I create the email with the text "These are your employees total hours for last week. ¶¶" & $list

          It sends an email.. then moves onto the next supervisor. That seems to work well for me.

           

           

          • 2. Re: Gathering a list of variables
            philmodjunk

            List ( $list ; Employees::c_Full NameFIRST & " - "  & emp_TIMESHEETS::s_TotalHours )

            also works. I'd put it in a set variable script step and not use Let for this purpose, but that's pretty much a preference issue rather than one approach being better than the other.