Sometimes, you want to add a value to the parsed result that isn't found in the documents you are parsing. For example, you want to add an ID or a category that you'll use later in your app or CRM.
Parseur allows you to set such custom values using Static Fields. Let's see how!
What are Static Fields?
As their names suggest, Static Fields are manually typed in with fixed values. That is in contrast to normal Field values that are extracted from the text and can change from one document to another.
There are multiple options to create a static field for your documents:
Creating a Static Field while using the AI engine
There are two methods of creating a static field in your documents while using the AI engine.
Create a field, and give the AI some instructions to always return a specific output:
The above created 'Bank Code' field will always return '01AC' output for each document when processed:
Note: You can also use this method to generate a fallback value for a field that usually returns a value, i.e. 'Return country code USA when no country code is found'
Creating a Static Field while using the template engine
To add a static field to a template:
Step 1 - Open a template in the template editor (or create a new one)
Step 2 - Click on the Static tab in the right pane:
Step 3 - The list of available and in-use static fields appears:
To assign a custom value to a new field, click "New Static Field"
Enter a name for that field
Enter the value associated with that field's name
To assign a custom value to an existing field, locate this field in the list, click "Set static value", and enter the value:
Step 4 - Save the field.
Its name and value now appear in the list.
Step 5 - Once you've made all changes to the template, save it
Step 6 - Test your changes by either:
sending a new email
or reprocessing an existing one using the "refresh" button icon next to a document
How to edit or delete a Static Field?
To edit or delete a Static Field from your template:
Repeat steps 1 to 3 above.
Then:
To edit a field, click on the "edit" button
To remove a field, click on the "cross" button
Creating a Static Field with our preprocessing module using Python:
Lastly, if you are on our Pro plan or higher, you can manually add static fields in our preprocessing module:
data["my_first_field"] = "Hello World!"