The Copy & Paste Values extension is designed to efficiently replicate data from one field to another within your Rossum documents. It simplifies data consistency across different document sections, ensuring uniformity and accuracy in data handling.
In this article we will cover:
Configuration Basics
To configure this extension once it’s activated, you’ll need to specify a ‘source field’ and a ‘target field’. Additionally, an optional ‘condition’ attribute can be used to apply the copying operation only when certain criteria are met. This conditional logic in the form of Pythonic expression adds a layer of flexibility, allowing for more targeted and dynamic data handling.
Example Configurations
Below are example configurations showcasing the varied applications of the Copy & Paste Values extension, from simple to advanced use cases.
Example 1: Simple copy from one field to another
Copies data from original_field
to duplicate_field
.
{
"operations": [
{
"source_field": "original_field",
"target_field": "duplicate_field"
}
]
}
Example 2: Copying a header value to each line item
Duplicates a value from header_field
to line_item_field
for every line item.
{
"operations": [
{
"source_field": "header_field",
"target_field": "line_item_field"
}
]
}
Example 3: Conditional copy
This setup copies data from conditional_source_field
to conditional_target_field
when condition_field
equals ‘specific_value’.
{
"operations": [
{
"condition": "{condition_field} == 'specific_value'",
"source_field": "conditional_source_field",
"target_field": "conditional_target_field"
}
]
}
Example 4: Distribution of the PO number to the line items
The configuration of the Value Operations extension below assigns the Order Number from the header to line items. If an Order Number is present at both header and line item levels, the line item value is prioritized in the calculated field. Otherwise, the header value is used for line items lacking their own
In this setup, the configuration involves two operations: the first distributes the header value to line items lacking an item_order_id
, and the second copies item_order_id
values where they exist. This results in a item_order_id_calculated
column populated with PO numbers from across the document.
{
"operations": [
{
"condition": "len({line_items}) > 0 and {item_order_id} == ''",
"source_field": "order_id",
"target_field": "item_order_id_calculated"
},
{
"condition": "len({line_items}) > 0 and {item_order_id} != ''",
"source_field": "item_order_id",
"target_field": "item_order_id_calculated"
}
]
}
Conclusion
In conclusion, the Copy & Paste Values extension is an invaluable tool in Rossum for ensuring data consistency and accuracy across your documents. It streamlines your workflow by simplifying the process of duplicating and distributing values. If you encounter any challenges or have questions while setting up or using this extension, don’t hesitate to reach out to Rossum support for assistance. We’re here to help you optimize your document processing experience.