---
title: How to make a corrective action field required based on another field's numerical range
description: You can make the 'Comment - Corrective Action' field required based on the value of another field by setting up a specific series of validation rules on the comment field itself.
---

[Skip to content](https://support.ofsystems.com/how-to-make-a-corrective-action-field-required-based-on-another-fields-numerical-range#main-content)

![OFS\_Circle.png\]](https://support.ofsystems.com/hs-fs/hubfs/OFS_Circle.png?height=45&name=OFS_Circle.png)

- [OFS Customer Portal](https://support.ofsystems.com/)
- [Main Website](https://ofsystems.com/)
- [Contact Us](https://www.ofsystems.com/contact-us?)
- [Service Portal](https://ofsystems.atlassian.net/servicedesk/customer/portal/1)

Open main navigation

Close main navigation

- [OFS Customer Portal](https://support.ofsystems.com/)
- [Main Website](https://ofsystems.com/)
- [Contact Us](https://www.ofsystems.com/contact-us?)
- [Service Portal](https://ofsystems.atlassian.net/servicedesk/customer/portal/1)

 Welcome to the OFS Customer Portal

- There are no suggestions because the search field is empty.

1. [OFS Customer Portal](https://support.ofsystems.com/?hsLang=en)
2. [How To Questions](https://support.ofsystems.com/how-to-questions?hsLang=en)
3. [Flow - Validations](https://support.ofsystems.com/how-to-questions?hsLang=en#flow-validations)

# How to make a corrective action field required based on another field's numerical range

## You can make a comment or corrective-action field required based on the value of another field, by setting up a series of validation rules on the comment field itself.

In this example, the validation is set on the **Corrective Action** field, based on the value of **Field A**. **Field A** is valid between 5 and 8; outside that range, **Corrective Action** becomes mandatory.

You'll create three rules on **Corrective Action**, checked from top to bottom.

#### **Step 1 — Mark as valid when Field A is in range**

This rule marks **Corrective Action** as valid, and optional, when **Field A** is within its normal range:

```
(data["FieldA"] >= 5) && (data["FieldA"] <= 8)
```

- **Mark form as:** Valid
- **With message:** "No action needed."

![](https://support.ofsystems.com/hs-fs/hubfs/image-png-Nov-10-2025-01-27-12-2714-AM.png?width=662&height=217&name=image-png-Nov-10-2025-01-27-12-2714-AM.png)

#### **Step 2 — Mark as valid when Field A is out of range and Corrective Action is filled**

This rule marks **Corrective Action** as valid only if **Field A** is out of range (0–4.99 or 8.01–10) and a comment has been entered:

```
(((data["Field A"]>=0)&&(data["Field A"]<5))||((data["Field A"]>8)&&(data["Field A"]<=10)))&&(data["CorrectiveAction"]!=0)
```

- **Otherwise, mark form as:** `Valid`
- **With message:** "Corrective action provided.

![](https://support.ofsystems.com/hs-fs/hubfs/image-png-Nov-10-2025-01-21-34-8847-AM.png?width=662&height=364&name=image-png-Nov-10-2025-01-21-34-8847-AM.png)

#### **Step 3 — Add the catch-all invalid rule**

This rule makes **Corrective Action** invalid if **Field A** is out of range and the comment has not been filled in:

```
((data["Field A"]>=0)&&(data["Field A"]<5))||((data["Field A"]>8)&&(data["Field A"]<=10))
```

- **Otherwise, mark form as:** `Invalid` or `Error`
- **With message:** "A corrective action comment is required when the value is out of range."

![](https://support.ofsystems.com/hs-fs/hubfs/image-png-Nov-10-2025-01-22-21-3331-AM.png?width=662&height=277&name=image-png-Nov-10-2025-01-22-21-3331-AM.png)

---

#### **Test it**

![](https://support.ofsystems.com/hs-fs/hubfs/image-png-Nov-10-2025-01-24-51-2969-AM.png?width=670&height=232&name=image-png-Nov-10-2025-01-24-51-2969-AM.png)

![](https://support.ofsystems.com/hs-fs/hubfs/image-png-Nov-10-2025-01-25-16-8140-AM.png?width=670&height=233&name=image-png-Nov-10-2025-01-25-16-8140-AM.png)

![](https://support.ofsystems.com/hs-fs/hubfs/image-png-Nov-10-2025-01-25-29-4166-AM.png?width=670&height=242&name=image-png-Nov-10-2025-01-25-29-4166-AM.png)

- [Getting Started](https://support.ofsystems.com/getting-started?hsLang=en#main-content)

    - [Console: The Basics](https://support.ofsystems.com/getting-started?hsLang=en#console-the-basics)
    - [Analytics: The Basics](https://support.ofsystems.com/getting-started?hsLang=en#analytics-the-basics)
    - [Fusion Manager: The Basics](https://support.ofsystems.com/getting-started?hsLang=en#fusion-manager-the-basics)
    - [OFS-Flow Training : The Basics](https://support.ofsystems.com/getting-started?hsLang=en#ofs-flow-training-the-basics)
    - [OFS-Go](https://support.ofsystems.com/getting-started?hsLang=en#ofs-go)
    - [MayvnAI](https://support.ofsystems.com/getting-started?hsLang=en#mayvnai)
- [Help & Support](https://support.ofsystems.com/help-support?hsLang=en#main-content)

    - [Troubleshooting](https://support.ofsystems.com/help-support?hsLang=en#troubleshooting)
    - [OFS in a Box](https://support.ofsystems.com/help-support?hsLang=en#ofs-in-a-box)
    - [Routers](https://support.ofsystems.com/help-support?hsLang=en#routers)
    - [PLCs](https://support.ofsystems.com/help-support?hsLang=en#plcs)
- [Success with MayvnAI](https://support.ofsystems.com/success-with-mayvnai?hsLang=en)
- [Training Videos](https://support.ofsystems.com/training-videos?hsLang=en#main-content)

    - [Operator Console](https://support.ofsystems.com/training-videos?hsLang=en#operator-console)
    - [OFS Analytics](https://support.ofsystems.com/training-videos?hsLang=en#ofs-analytics)
    - [Fusion-Manager](https://support.ofsystems.com/training-videos?hsLang=en#fusion-manager)
    - [OFS-Flow](https://support.ofsystems.com/training-videos?hsLang=en#ofs-flow)
    - [OFS-Go](https://support.ofsystems.com/training-videos?hsLang=en#ofs-go)
- [How To Questions](https://support.ofsystems.com/how-to-questions?hsLang=en#main-content)

    - [Administration](https://support.ofsystems.com/how-to-questions?hsLang=en#administration)
    - [Operator Console](https://support.ofsystems.com/how-to-questions?hsLang=en#operator-console)
    - [Analytics](https://support.ofsystems.com/how-to-questions?hsLang=en#analytics)
    - [Fusion Manager](https://support.ofsystems.com/how-to-questions?hsLang=en#fusion-manager)
    - [Fusion Manager - Alerts & Services](https://support.ofsystems.com/how-to-questions?hsLang=en#fusion-manager-alerts-services)
    - [Flow](https://support.ofsystems.com/how-to-questions?hsLang=en#flow)
    - [Flow - Validations](https://support.ofsystems.com/how-to-questions?hsLang=en#flow-validations)
    - [Flow - Conditional Expression & Triggers](https://support.ofsystems.com/how-to-questions?hsLang=en#flow-conditional-expression-triggers)
    - [APIs](https://support.ofsystems.com/how-to-questions?hsLang=en#apis)
- [FAQs](https://support.ofsystems.com/faqs?hsLang=en#main-content)

    - [Operator Console](https://support.ofsystems.com/faqs?hsLang=en#operator-console)
    - [Fusion Manager](https://support.ofsystems.com/faqs?hsLang=en#fusion-manager)
    - [Analytics](https://support.ofsystems.com/faqs?hsLang=en#analytics)
    - [OFS-Flow](https://support.ofsystems.com/faqs?hsLang=en#ofs-flow)
- [Case Studies](https://support.ofsystems.com/case-studies?hsLang=en#main-content)

    - [Mavyn AI](https://support.ofsystems.com/case-studies?hsLang=en#mavyn-ai)
- [OFS Guides](https://support.ofsystems.com/ofs-guides?hsLang=en)
- [Webinars](https://support.ofsystems.com/webinars?hsLang=en)

[![](https://support.ofsystems.com/hs-fs/hubfs/Logo%20Medium_no%20words.png?width=128&height=68&name=Logo%20Medium_no%20words.png)](http://ofsystems.com)

Operations Feedback Pty Ltd

7/627 Chapel St, South Yarra, VIC 3123  
+61 3 8684 9859

<https://www.ofsystems.com/> <https://www.linkedin.com/company/operations-feedback-systems/> [mailto:support@ofsystems.com](mailto:support@ofsystems.com)

Copyright © 2025, Operations Feedback Systems Pty Ltd.