How to validate user entered input names with structured input data

12 Dec, 2023

How to validate user entered input names with structured input data

How to validate user entered input names with structured input data


This tutorial will show you how to match up user-entered input names with structured input data from databases like CDMS and Agrian. Essentially, we will show you how to validate or change the suggestions that Leaf proposes about the products used in certain operations.

Why use Leaf Input Validator?

  • Easily search for products used in an operation
  • Enable easy correction or confirmation of the input match made by Leaf
  • Greater precision and a more practical output of the products used in operations


1. Register for a Leaf account

First, you’ll need to register for a Leaf account. If you don’t yet have an account you can register below. Make sure to activate your account via the activation email.

Register with Leaf -->

2. Authenticate to access Leaf’s API

Next, you’ll need to authenticate by requesting your access token:

Note: to use the following matching and product endpoints, you must have a Leaf User authenticated with a provider that has 'applied' field operations (field operations tutorial coming soon).

View documentation -->

3. Get matching products from the Leaf Input Validator

You can use the ID from an "As-applied" Field Operation, and the Leaf Input Validator will predict a match for the products used in the operation:

View documentation -->

4. See the product details

For each product used in the operation, you can check more information from the Leaf validation suggestion. Input details such as the active ingredient, label, and registration IDs are available using the productId. Check it with the following example:

5. Update the product matching validation

The suggestion provided by Leaf can be confirmed/validated or modified, so Leaf can learn from it in the future. Here is an example:

To validate a product matching, use this payload:

If you need to change the prediction, use the productId found in the other product endpoints, like in the search.

Once you find the correct productID, send it to the update endpoint to validate.

For more details related to Leaf's Input Validator, head to the documentation here:

View documentation -->

You're now set up with Leaf's input validator! If you have any further questions, please don't hesitate to send us an email at

Where to next?

--> Magic Link--> Field Boundaries --> Manual File Upload --> Crop Monitoring --> Back to 'for developers'

Ready to begin?

Get API Keys and Start Building Today!

Sign up for free account

Questions? Get in touch