Questions about computed fields

My questions are here-

  1. Can we print a computed value based on some conditions? Such as, “Only when I can locate in the document, I am safe to print the computed value bank_institution_name as “ACME”? (by the way, this config is for only one institution)

  2. Do computed values behave like additional set of fields(custom fields) in the JSON? Are they typically outside the fields block […] ?

(cross posted into community by admin)

  1. if the config is always for the same institution, you probably just want to add fingerprints to the config for being completely sure that you have a document from that institution. And then I’d recommend just using a computed field with the constant method to always return the bank_institution_name. Here are the docs on how to use constant. Alternatively, if you wanted to transform a source field into a new string (like “amce inc” to “ACME” you can use a mapper computed field.

  2. Computed fields are fields that can be used to transform the output of normal fields. The computed fields array is always located outside of the regular fields array.