---
title: "Example 1 - Simple Conditional Checklist"
canonical: "https://help.fieldbuddy.com/space/FBDOCS/6023544856/Example%201%20-%20Simple%20Conditional%20Checklist"
format: markdown
---
---

The requirements of this checklist are as follows:

- Ask whether the user owns a car.
  - If yes, ask about the brand(s) of the car(s) the user owns.
    - There should be set of preset answers, so that the user doesn’t spend extra time entering the values themselves.
    - There should be an “Other” option, that user can choose to enter another brand of car, if the car brand is not in the preset answers list.
  - If no, ask about the mode of transport of the user.
    - There should be set of preset answers, so that the user doesn’t spend extra time entering the values themselves.
    - There should be an “Other” option, that user can choose to enter another mode of transport, if the mode of transport is not in the preset answers list.


---

Let’s start by following the steps outlined here [https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/6020071431/Filter+Logic+in+Checklists#How-to-make-a-field-conditional-on-other-fields%27-values](https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/6020071431/Filter+Logic+in+Checklists#How-to-make-a-field-conditional-on-other-fields%27-values) .


#  📘  Instructions

## Step 1: Create the WOLI and WOIDs

We will name our WOLI “Simple Conditional Checklist”. We will set its type to `Activity`, and its display type to be `Checklist` .

Next, we will create the WOIDs that we need, with the order that we would like to see them in. We also choose a fitting type for each type of WOID.

| **WOID** | **Type** | **Page** | **Order** | **Picklist values** |
| --- | --- | --- | --- | --- |
| Page | Page | 100 | 100 | - |
| Do you own a car? | LabelPicklist | 100 | 101 | ```
Yes
No
``` |
| Which brand cars? | MultiSelectPicklist | 100 | 102 | ```
BMW
VW
Audi
Other
``` |
| What’s your transport? | Label Picklist | 100 | 103 | ```
Rent a car
Bicycle/bike
Public transport
Other
``` |
| Please specify the brand of cars you own. | Text | 100 | 104 | - |
| Please specify the mode of transport you use. | Text | 100 | 105 | - |

## Step 2: Assign API Name values to fields

If we want filter logic to be able to refer to a field, we will need to assign an API name to it.

- Some fields require us to know whether user owns a car or not, thus we need to assign an API Name to this field. Let’s call it `userOwnsCar`.
- A field requires us to know whether used picked “Other” as option when they specified which brand of cars they own. Let’s call it `brand`.
- A field requires us to know whether used picked “Other” as option when they specified which mode of transport they use. Let’s call it `transport`.

> ⚠️ Make sure to add an API name value to fields to every field with filter logic, as well. Otherwise, the conditionality may not work as expected.
> ⚠️ 
> ⚠️ In the example below, the last two fields do not have any dependents, but they still require API names (`other_brand`, `other_transport`)

Here is what the API names look like per WOID:

| **WOID** | **API Name** | **Picklist values** |
| --- | --- | --- |
| Page | - | - |
| Do you own a car? | `userOwnsCar` | ```
Yes
No
``` |
| Which brand cars? | `brand` | ```
BMW
VW
Audi
Other
``` |
| What’s your transport? | `transport` | ```
Rent a car
Bicycle/bike
Public transport
Other
``` |
| Please specify the brand of cars you own. | `other_brand` | - |
| Please specify the mode of transport you use. | `other_transport` | - |

## Step 3: Constuct the filter logic, and assign these to fields

Now that we have the API names that we need, we can refer to the values of WOIDs in our filter logic.

- We would like the question `Which brand cars?` to appear only when the user answered “Yes” to the question `Do you own a car?`. So we set up the filter logic of this WOID like this:

```
(userOwnsCar)=>{return userOwnsCar == 'Yes'}
```

- We would like the question `What’s your transport?` to appear only when the user answered “No” to the question `Do you own a car?`. So we set up the filter logic of this WOID like this:

```
(userOwnsCar)=>{return userOwnsCar == 'No'}
```

- We would like the question `Please specify the brand of cars you own` to appear only when the user’s answer includes “Other” to the question `Which brand cars?`. We would also like to only display this question if the user answered “Yes” to the question `Do you own a car?`. So we set up the filter logic of this WOID like this:

```
(userOwnsCar, brand)=>{return userOwnsCar=='Yes' && brand.includes('Other')}
```

- We would like the question `Please specify the mode of transport you use` to appear only when the user’s answer includes “Other” to the question `Which brand cars?`. We would also like to only display this question if the user answered “No” to the question `Do you own a car?`. So we set up the filter logic of this WOID like this:

```
(userOwnsCar, transport)=>{return userOwnsCar=='No' && transport.includes('Other')}
```

| **WOID** | **API Name** | **Filter Logic** | **Picklist values** |
| --- | --- | --- | --- |
| Page | - | - | - |
| Do you own a car? | `userOwnsCar` | - | ```
Yes
No
``` |
| Which brand cars? | `brand` | `(userOwnsCar)=>{return userOwnsCar == 'Yes'}` | ```
BMW
VW
Audi
Other
``` |
| What’s your transport? | `transport` | `(userOwnsCar)=>{return userOwnsCar == 'No'}` | ```
Rent a car
Bicycle/bike
Public transport
Other
``` |
| Please specify the brand of cars you own. | - | `(userOwnsCar, brand)=>{return userOwnsCar=='Yes' && brand.includes('Other')}` | - |
| Please specify the mode of transport you use. | - | `(userOwnsCar, transport)=>{return userOwnsCar=='No' && transport.includes('Other')}` | - |

---

The finished checklist should function like this:

---

All done! 🎊 

If you’d like to see another example, continue with:

[https://help.fieldbuddy.com/space/FBDOCS/6024888321](https://help.fieldbuddy.com/space/FBDOCS/6024888321)