Forum Discussion

tdhoffman's avatar
tdhoffman
Qrew Trainee
15 days ago
Solved

Email each user their record

Hello! I'm new to Quickbase and have been using the API to speed up operations at my company. We have a report that is generated weekly whose records need to be sent to each user. Typically, this is ...
  • MarkShnier__You's avatar
    15 days ago

    Here are some thoughts. F for example your use cases that you're emailing each employee a list of their weekly tasks then you can probably do this without any kind of automated pipeline. So if the relationship is one employee has many tasks on the task can have a look up field for the user ID of the assigned employee, then you can simply make a report of My Tasks  filtered by where the assigned employee is the current user and then you can set up a subscription report to go to all employees once a week. You will find that each employee only gets a report of their own tasks. 

    If you really do want to  email each employee their own record each week than the next easiest thing to do is to set a date time field called Perhaps email notification trigger   and then set up a notification or a build you own custom email that triggers when that date time field is updated.

    Then you would set up a pipeline, and the first step of the pipeline would be to search the employee table for a list of qualifying employees. For example, maybe there's a flag on the employee record as to whether they are active or there may be some other conditions.

    Then the pipeline will suggest a for each loop next and inside that loop you will want to set the date time trigger field for the email to be the current date and time.

    One way to do that is to use the simple Jinja syntax of {{time.now}}

    If you want to stay away from Jinja, because the brace brackets are a little scary looking then you can create a native field record called the current date time with a formula of  now() and then use that field in the pipeline to populate that date time trigger field for the email notification.

    Once you have the pipeline set up, then you can click near the top right to schedule it to run once a week at a certain time. When we do that, the time is loaded in what's called UTC format, which is the time in London, England, so you will have to do the mental math on what time it is in your time zone. For example, if you were in the eastern time zone, then you would probably want to trigger email about 12 PM UTC so that arrives at 7 AM Eastern 

    Feel free to post back if you have any questions