# Automate the Act of Repetition

> Let the computer do the same job again and again, so people spend their effort on choices that really need them.

**In short:** Automating repetition means letting the computer do the same job again and again, so people spend effort on choices that really need them.

From "UI/UX basics", a free course by Venkat R. Murty: https://designervenkat.online/learn/ui-ux/automate-the-act-of-repetition

## What you will learn

Many people repeat the same tasks again and again. They log in, type the same address, or copy the same text into a new message. Good design can take over some of this work. In this lesson you will learn how to spot repeated work and automate it, so the user only has to make the choices that need a person.

- **Repetition:** Doing the same action many times.
- **Automation:** Letting the computer carry out a task that a person would otherwise do by hand.
- **Autofill:** The browser or app filling in a form field with information it already holds.
- **Accelerator:** A faster way to reach the same result, such as a keyboard shortcut. New users can ignore it.
- **Macro:** A saved set of steps that runs in one go after a single trigger.
- **Novice user:** A person who is new to a product.
- **Expert user:** A person who uses a product often and knows it well.

## Why does repeated work matter?

Nielsen Norman Group, a user research firm, has written that people spend most of their time online on tasks they already know. One of its writers said this was a guess, not an exact figure. Users also tend to dislike change once they have learned how a site works, so a design that keeps repeated tasks fast helps people succeed.

- **Saves time:** Less typing means each task finishes sooner.
- **Less effort:** People can spend their attention on the one choice that matters, instead of on copying details.

## What are the ways to automate repeated work?

There are two main tools. The first fills in information for the user. The second gives experienced users faster routes. Nielsen's seventh usability rule says a design should suit both novice and expert users, and it names accelerators as one way to do so.

### Autofill and saved answers

Autofill works best when the form gives the browser clear labels. Chrome's developer guide says browsers can store and fill in data when each field has a stable name or id and an autocomplete attribute. An autocomplete attribute is a code label that tells the browser what the field is for. The EAS framework from Nielsen Norman Group includes an 'Automate where possible' step, which covers using data the system already has or can infer.

> **Tip:** Ask only for what you truly need. Each field you remove is one less thing a returning user has to type again.

```python
saved = {'name': 'Ana Lopez', 'city': 'Lisbon', 'country': 'Portugal'}
form = {'name': '', 'city': '', 'country': '', 'newsletter': False}
for field in saved:
    form[field] = saved[field]
print(form)
```

Output:

```text
{'name': 'Ana Lopez', 'city': 'Lisbon', 'country': 'Portugal', 'newsletter': False}

```

The sample above copies saved answers into a blank form. The user still picks the newsletter option, because that choice is theirs to make.

### Shortcuts and macros

An accelerator gives an experienced user a quicker route to the same result. Nielsen Norman Group says these shortcuts stay out of sight of new users, so they do not confuse them. A macro goes a step further. It runs a series of commands from one trigger, which suits tasks with steps that do not change. The sample below shows the idea in plain code.

```python
def run_macro(steps):
    for step in steps:
        print('done:', step)

run_macro(['open file', 'fix title', 'save file'])
```

Output:

```text
done: open file
done: fix title
done: save file

```

1. **Find the repeated task:** Watch real users and note the actions they repeat most often.
2. **Pick a short trigger:** Choose a key combination or button that is easy to remember.
3. **Show the hint:** Show the shortcut next to the menu item so people can learn it over time.
4. **Keep the slow path:** The step-by-step route must still work for new users.
5. **Test with both groups:** Check the design with new users and with experienced users.

## Why keep the easy path open?

A design built only for experts is hard to learn. Nielsen Norman Group notes that keyboard combinations are fast, but they ask more of the user's memory. Automation should help people choose, not force them to remember. Good designs offer more than one way to finish a task, so each person can pick the one that fits.

> **Tip:** Show shortcuts gently, for example in tooltips or hints. Showing a shortcut on the screen can help people learn it over time.

## Check your understanding

**Quick check:** Which design best follows the idea of automating repetition?

A. Make every returning user type their address again.
B. Fill known details from saved data, and let the user change them.
C. Hide every shortcut so the screen looks empty.

**Answer:** B. Filling known details saves time. Letting the user change them keeps control in their hands.

## Key takeaways

- **Find the repeats:** Look for tasks people do again and again, and automate those first.
- **Fill what you know:** Use saved or inferable data, and ask only for what is needed.
- **Add, do not replace:** Give experts shortcuts, but keep the clear path for new users.

## Sources

- [Nielsen Norman Group: Flexibility and Efficiency of Use (Usability Heuristic #7)](https://www.nngroup.com/articles/flexibility-efficiency-heuristic/)
- [Nielsen Norman Group: Less Effort, More Completion: The EAS Framework for Simplifying Forms](https://www.nngroup.com/articles/eas-framework-simplify-forms/)
- [Nielsen Norman Group: Usability for Novel vs. Routine Tasks](https://www.nngroup.com/articles/novel-vs-routine-tasks/)
- [Chrome for Developers: Build a sign-in form that follows best practice](https://developer.chrome.com/docs/modern-web-guidance/guides/forms/autofill-sign-in-form)
- [The Decision Lab: Nielsen's Heuristics](https://thedecisionlab.com/reference-guide/design/nielsens-heuristics)
- [Falcon: Flexibility and Efficiency of Use (Nielsen #7)](https://falcon.so/resources/principles/flexibility-and-efficiency-of-use)
- [CXL: Form Design Principles: 13 Empirically Backed Best Practices](https://cxl.com/blog/form-design-best-practices/)
