---
title: How to reference a previous job in validation using the Job Context Selector
description: The Job Context Selector field lets you pull metadata from a previous job run into your form, so you can validate current entries against data from an earlier job on the same line.
---

[Skip to content](https://support.ofsystems.com/how-to-reference-a-previous-job-in-validation-using-the-job-context-selector#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 reference a previous job in validation using the Job Context Selector

## The Job Context Selector field lets you pull metadata from a previous job run into your form, so you can validate current entries against data from an earlier job on the same line.

#### **Step 1 — Add a Job Context Selector field to your form**

Open your form in **OFS-Flow** and go to the **Form Layout** tab.

Scroll to the bottom of the field type list and drag a **Job Context Selector** onto your form layout.

![Screenshot 2026-06-17 at 4.45.50 pm](https://support.ofsystems.com/hs-fs/hubfs/Screenshot%202026-06-17%20at%204.45.50%20pm.png?width=261&height=428&name=Screenshot%202026-06-17%20at%204.45.50%20pm.png)

**Step 2 — Configure the field properties**

Select the **Job Context Selector** field to open its **Field Properties** panel.

Set the following:

- **Unique Field Name** — This is the name you'll reference in validation expressions   
  e.g. jobsel
- **Required** — leave **Off** unless you want the operator to be forced to select a job before submitting.
- **Recent Jobs to Show** — enter the number of recent job runs to display when the operator uses the selector. The default is 3.
- **Form Field Label** — optional display label shown to the operator e.g. Job Context Selector

![Screenshot 2026-06-26 at 2.23.45 pm](https://support.ofsystems.com/hs-fs/hubfs/Screenshot%202026-06-26%20at%202.23.45%20pm.png?width=670&height=164&name=Screenshot%202026-06-26%20at%202.23.45%20pm.png)

#### **Step 3 — Reference the selected job in a validation rule**

Go to the **Field Validation Rules** tab for the field you want to validate (e.g. a **Text Field or Integer Field** where the operator scans a label code).

- Drag in the field you want to validate e.g. data\["Text Field"\]
- Drag in the '=' from the math operators
- Build your condition using the job's metadata. The Job Context Selector makes this available at the following path: 
    - data\["jobsel"\].job.metadata.\<property\>
    - Replace \<property\> with the metadata field you want to compare against — for example, labelCode.

A complete example:

data\["text field"\]==data\["jobsel"\].job.metadata.ratedSpeed

![Screenshot 2026-06-17 at 4.51.18 pm](https://support.ofsystems.com/hs-fs/hubfs/Screenshot%202026-06-17%20at%204.51.18%20pm.png?width=670&height=299&name=Screenshot%202026-06-17%20at%204.51.18%20pm.png)

#### **Step 4 — Set the rule outcome**

Configure the rule to **Mark form as Valid** (or **Invalid**, depending on your logic) and add a message if needed — for example: *"Label code does not match the previous job. Please check and try again."*

*Don't forget the catch-all rule:*

```
1==1
```

![](https://support.ofsystems.com/hs-fs/hubfs/image-png-Jun-17-2026-06-58-07-2062-AM.png?width=457&height=322&name=image-png-Jun-17-2026-06-58-07-2062-AM.png)

Save your form when done.

#### **Adapting it to your own form**

The job.metadata object can hold a range of properties depending on your line and job configuration. Common examples:

- productCode — the product SKU or code
- batchNumber — the batch or lot number

You can use the Job Context Selector in any validation expression where you need to compare a current form entry against a previous job's recorded data — not just barcodes or text fields.

All metadata properties can be viewed in the Products tab of Fusion Manager.

- [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.