Skip to main content
Join the Agentforce Hackathon on Nov. 18-19 to compete for a $20,000 Grand Prize. Sign up now. Terms apply.

Simplify Shift Creation with Templates and Patterns

Learning Objectives

After completing this unit, you’ll be able to:

  • Create templates to speed up creating shifts.
  • Use Shift Patterns to create large numbers of shifts at once.

In the previous unit, you created a shift and assigned Andrew Ferguson to it. But what if you have 10 shifts to assign every day? That’s 50 shifts a week, and a lot of effort if you have to create them all individually. That’s also time you could be spending sorting all the pencils on your desk by length, which you’ve been meaning to do for a long time.

Don’t despair! Fortunately, templates and patterns make shift creation easy.

Templates Make It Easy

Let’s say you want to make a shift for a driver who works 9 to 5. You could create a shift from scratch, but using a template means that many of the fields in the new shift are prepopulated for you, saving you some work. 

Shift Templates listview

To see existing shift templates, click  App Launcher and enter Shift Templates. To create a new template, click the New button on a Shift Templates list view page. 

In this case, you’re lucky; you don’t need to create a new Shift Template. A coworker has already created a Shift Template for drivers who work 9 to 5, called Weekly on Call. Buy your coworker a nice gift (cashmere socks that say, “I Created a Shift Template” never go out of style), and get ready to create a shift from that template. 

Creating a shift from a template

  1. From the Shifts list view, click New from Template. A New from Template window appears.New from Template
  2. In the Shift Template ID field, type Weekly on Call and select the Weekly on Call template.
    Now numerous fields are filled out for you, like start and end times, Job Profile, and status. (Which fields get populated depends on the template.)
  3. Change or fill out any fields as needed and save the shift. Presto! New shift.

Patterns Make It Even Easier

Using a template simplifies and speeds up the process of creating a single shift. For creating a small number of shifts, that’s fine. But as executive vice-president for Shift Creation and Assignment at your company, you need to create a lot of shifts, so you want to speed up the process. That’s where the shift pattern object comes in. 

A shift pattern is just what it sounds like: a configuration of shifts that repeats. For example, if a driver works three morning shifts and two evening shifts a week for 3 weeks, you can create a weekly pattern for them and repeat it three times. 

  • You can create a pattern based on a service resource, as in our driver example.
  • You can also create a pattern based on need. For example, a restaurant might need three cooks and four waiters to work weekend evenings for 6 months. In that case, you’d set up a monthly pattern of unassigned shifts that repeats six times.

Shift Patterns

Let’s say you want to set up on-call shifts for two drivers for the next two months. 

  1. Go to the  App Launcher and enter Shift Patterns. Fortunately, there’s one that’s just what you’re looking for: Weekly on call pattern. (The name should sound familiar.)
  2. Click that pattern.Shift Pattern Details tabThe page for the Weekly on call pattern comes up. On the Details tab you see the name of the pattern, a description, a pattern length, and whether the pattern is active or not. The length is always in days. Since this is a weekly pattern, the length is 7. A monthly pattern might have a length of 30 or 31 days, or 28 days, or—once every 4 years—29 days. The Gregorian calendar certainly is remarkable. Shift pattern entriesOn the Related tab, there is a list of Shift Pattern Entries, which link the pattern to templates. Remember templates? Patterns use templates as the basis for the repeating sequence. In this case, five of the six shift pattern entries point to our old friend, the Weekly on Call template, while one entry points to a template called Non-standard.

    Each entry includes a Day Position, from 1 to 7, corresponding to days of the week. Each day has one or more templates associated with it, meaning that shifts for that day are created using its templates. Day 1 actually has two entries, because on Mondays you need two drivers. One of the drivers will have shifts based on the Weekly on Call template, while the other’s shifts will be based on the Non-standard template. (Multiple templates on the same day need not be different; one driver could have a partner who’s working the same shift. In this case, the drivers are working different shifts.) As there are no entries for Day 3, that means it’s a day off. New from Pattern buttonSo you’ve found a pattern of shifts for a week, Weekly on call pattern, that meets your needs. Satisfied, you head to the Shifts tab.
  3. Click New from Pattern to create some shifts. The New Shifts from Pattern window appears. New from Shifts Pattern window
  4. In the Shift Pattern field, type Weekly on call to find the pattern you want.
  5. Choose a start date from the popup calendar. You want the drivers to work these shifts for the next 2 months, so you can either enter an end date, or enter 8 as the number of occurrences (8 weeks = 2 months).
  6. Leave the Status as Tentative.
  7. Leave the territory field blank.
    In this case you also leave the Assigned Service Resource field blank. Why? If the pattern were only meant for one driver, you could add their name here, and all the shifts would go to that one driver. But remember, the pattern you’re using creates two shifts on Day 1. If you assign a service resource now, that driver will wind up with both of those shifts. That’s permissible–people can work multiple shifts in a day–but you want two different drivers working on Mondays. So you leave Assigned Service Resource blank, and you assign the drivers to the shifts later. (In the next unit, you see how to assign multiple people to multiple shifts.) At the bottom of the New from Pattern window, the results of your choices are displayed: You’re creating 48 new shifts, which is what you want.
  8. Click Create Shifts.

Voilà. Forty-eight unassigned shifts, covering the next 2 months. 

Templates and patterns really streamline the process of creating and assigning shifts. But you can really turbocharge all that through automation, as you see in the next unit. 

Resources

Comparta sus comentarios sobre Trailhead en la Ayuda de Salesforce.

Nos encantaría conocer su experiencia con Trailhead. Ahora puede acceder al nuevo formulario de comentarios cuando quiera desde el sitio de la Ayuda de Salesforce.

Más información Continuar para compartir comentarios