# Build a Check Sheet

A **check sheet** is the reusable template for a check, like a blank form. Each question on it is a **check item**. You
build the form once, and Quality Inspectors fill it in each time it is due. This lesson shows you how to create a check sheet and
set up its checks. Nothing is recorded while you build.

:::info
Building a check sheet needs the **Configure Quality** security function.
:::

## Create the Check Sheet

1. Open **Configuration → Quality → Check Sheets**.
2. Add a check sheet and give it a name. You must name it before you can do anything else with it.
3. Click outside the name field. Kanoa saves the check sheet as soon as it has a name.

{/*
TODO: Confirm on a gateway the label of the add button.
*/}

![Check Sheets](https://docs.kanoa.ai/img/quality/checkSheets.png)

The editor has four tabs:

- **Info** holds a description and links to other documents, such as SOPs.
- **Settings** holds the general settings.
- **Checks** holds the questions to answer.
- **Triggers** holds what schedules the check sheet. The next lesson covers it.

**Estimated Minutes** is how long you expect a manual check sheet to take. Entering a value adds a **duration** check item
that the inspector fills in, so you can see how long the checks really take.

## Choose the Settings

On the **Settings** tab, choose how the check sheet behaves.

![Settings tab](https://docs.kanoa.ai/img/quality/chkShtEditorSettingsTab.png)

| Setting | What it does |
| --- | --- |
| **Enabled** | Turns the check sheet on or off. |
| **Sign Off Required** | A submitted check waits for approval. If cleared, it goes straight to **Approved**. |
| **Auto** | The check sheet holds only checks whose values are captured automatically. |
| **Folder** | Saves the check sheet in a folder. |
| **Asset Required** / **Item Required** | The inspector must choose an asset or an item. |
| **Issue Check Sheet** | Another check sheet to schedule right away when a test fails. |
| **Notifications** | A team or user to email when a test fails. |
| **Sync Date** | Uses a datetime check as the **Taken Date** of every check on the sheet. |

Only **Approved** checks are used in reports and SPC. That makes **Sign Off Required** your quality gate. The sample
Cleanliness Check clears it. The sample Offline Lab Inspection sets it.

::embed-section{src="../../kanoa-quality/checkSheets.md#check-sheet-settings" collapsed="true" summary="Reference Materials: Check Sheet Settings - Every setting on the Settings tab."}

## Add Checks and Check Groups

On the **Checks** tab, a check sheet can hold any number of checks. Checks are grouped into tabs, so you can keep related
questions together.

1. Click the add button to add a check, or the edit button to change one.
2. Give the check a name and choose its group.
3. Set whether it is **Enabled** and whether it is required or optional.
4. Add **Instructions**. Inspectors read them when they select the check.

![Checks tab](https://docs.kanoa.ai/img/quality/chkShtEditorChecksTab.png)

While the check sheet is a **Draft** or **In Revision**, the buttons above the checks add, edit, copy and delete groups. The
arrows move a group left or right. **Copy Group** copies a group and all its checks, settings and specifications as a new
tab on the same check sheet.

::embed-section{src="../../kanoa-quality/checkSheets.md#check-groups" collapsed="true" summary="Reference Materials: Check Groups - Copy a group and what comes with it."}

### Check Type and Data Type

Each check has a **Check Type**:

- **Check** receives a value and stores it.
- **Calculated** works out a value from other checks. You can choose an aggregate, such as Average, Sum, Range, Min, Max or
  Standard Deviation, or write a formula.
- **Trigger** captures the values of other checks, such as values read from a PLC.

The **Data Type** is the kind of value expected: Boolean, Datetime, Float, Geo Location, Image, Integer or String. It decides
what the inspector sees when entering the value.

Custom calculation scripts need the Ignition Designer. That work belongs to the Developer Training.

![General settings of a check](https://docs.kanoa.ai/img/quality/chkItemGeneral.png)

::embed-section{src="../../kanoa-quality/checkSheets.md#check-item-settings---general" collapsed="true" summary="Reference Materials: Check Item Settings, General - Name, group, type and data type."}

## Set the Data Properties

![Data properties](https://docs.kanoa.ai/img/quality/chkItemDataProperties.png)

- **Number of Measurements** is how many readings to take per check. It allows within-subgroup variance analysis.
- **Assign Attribute** ties the check to a tolerance and a data source. The next lesson covers attributes.
- **Data Source Tag** reads the value from a tag when there is no attribute.
- **Dynamic** shows the check only when a valid tolerance exists for the item.
- **Units** sets the engineering units, such as °C, µm or ppm.
- **Format** sets how the value is shown.
- **Persistent** copies over the value entered the last time the check was taken.

::embed-section{src="../../kanoa-quality/checkSheets.md#check-item-settings---data-properties" collapsed="true" summary="Reference Materials: Check Item Data Properties - Measurements, attributes, units and format."}

## Set a Specification

For a String or number check, the **Specification** section sets the **Tolerance**. For a number, the choices are
**Attribute Tolerance** (when the check has an attribute), **Tolerance**, **Set Point** and **Range**. For a String, the
choice is **Regex**.

A **Range** works in two layers:

- A value outside the range is saved as **failed**.
- **Entry Limits** go further. A value outside them is refused when it is entered, with a message.

Set the entry limits equal to the range to make the range strict. A value outside it can't be entered at all.

::embed-section{src="../../kanoa-quality/checkSheets.md#specification" collapsed="true" summary="Reference Materials: Specification - Tolerance choices, range and entry limits."}

## Choose Entry Options

Entry options decide how an inspector enters the value. You don't need one. A text or number field always works, and the typed
value is validated.

![Entry options](https://docs.kanoa.ai/img/quality/chkItemEntryOptions.png)

The options depend on the data type:

- **Boolean** and **Text** make buttons from the values you list.
- **Number** and **Fraction** make buttons from the attribute tolerance, or from the values you list.
- **Time** shows a keypad for hours, minutes and seconds.
- **Tree** shows a tree selector.
- **Barcode Scanner** scans a barcode with a mobile device camera.

For the cleanliness check, a Text pick list has the responses `Clean` as Pass, `Passable` as Warning, and
`Over-Cluttered` and `Dirty` as Fail. One Fail on a required item makes the whole check **not OK**. A Warning doesn't.

::embed-section{src="../../kanoa-quality/checkSheets.md#check-item-settings---entry-options" collapsed="true" summary="Reference Materials: Entry Options - What each option does for each data type."}

## Try It Before You Release

A check sheet starts as a **Draft**, which inspectors can't use. A user with **Configure Quality** can select a Draft on the
**Check Sheets** screen and click **Launch Check Sheet**. This opens a test check that is deleted when you close it.

## Check Your Understanding

1. Which setting makes a submitted check wait for approval?
2. What is the difference between a range and its entry limits?
3. Which security function do you need to build a check sheet?

<details>
<summary>Answers</summary>

1. **Sign Off Required**. If it is cleared, a submitted check goes straight to **Approved**.
2. A value outside the range is saved as failed. A value outside the entry limits is refused when entered.
3. **Configure Quality**.

</details>
