Text Token Processor
FormX offers a powerful Text Token Processor feature that allows users to search for specific keywords in a document and return a predefined value in the JSON response. This documentation will guide you through the process of using the Text Token Processor in FormX.
What is a text token
In FormX, a Text Token is a predefined keyword that the system searches for in a document. Once the keyword is found, a predefined value is returned in the JSON response. For example, if you define "McDonald", "McDonald's", and "McCafe" as text tokens, and "McDonald's Corporation" as the Field Value, FormX will return {"company": "McDonald's Corporation"}
if any of the text tokens are found in the document.
Configuring Text Tokens
To configure the Text Token Processor in FormX, navigate to the "Custom Extraction Items" section located under "Document" on the right bar. Select "Text Token" from the list and click on "Add New Extraction Item" to create a new Text Token Processor. Click on "Settings" to configure the processor.
In the Text Token Processor settings, you can define the keywords that the system will search for in the document. For each keyword, you can define the field value that will be returned in the JSON response if the keyword is found.
Text token processor returns an array in the JSON response.
There are two match modes available in the Text Token Processor:
- The first is "Match ALL tokens", which means the array will include values for all tokens that matched.
- The second match mode is "Match ONE closest token only", at most only one value will be returned in the array, which is the closest to the token.
Text Token | Field Value |
---|---|
CH | Switzerland |
CHA | Chicago Housing Authority |
CHAN | African Nations Championship |
For example, given the token list shown above, and the phrase "CHAN" is present in the document.
- Match ALL tokens: All
["Switzerland", "Chicago Housing Authority", "African Nations Championship"]
will be returned - Match ONE closest token only: only
["African Nations Championship"]
will be returned because it's the closest text token.
Updated over 1 year ago