--- title: "Filter lines in copy and template lists" slug: "filter-lines-in-copy-template" description: "Configure filters to control what lines should be copied/deleted in Copy and Template lists." updated: 2024-05-14T13:06:43Z published: 2024-05-14T13:06:43Z canonical: "docs.zilliant.com/filter-lines-in-copy-template" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.zilliant.com/llms.txt > Use this file to discover all available pages before exploring further. # Filter lines in Copy and Template lists You can define a filter field that controls: - Which lines should be copied from a source document to a target document - Which lines on a target document should not be deleted when a template is applied ## Define a formula field Important The field that you create and specify in **sourceFilterField** must be on the object level that you are filtering. It cannot be on a parent or child object. - For **Copy** actions: - If this value is **True** on the source for a copy or template, the source line item is copied to the target. - If this value is **False** on the source, the source line item is ignored. - For **Template** actions: - The source template acts the same as the copy action. If the value is **True** on the source, the source line item is copied to the target agreement or quote. - The target agreement or quote into which the template items are being copied also uses this value, but in an inverse manner: - If the value is **True** on the target agreement or quote, the corresponding line is deleted from the target when the template is copied. - If the value is **False** on the target, the corresponding line remains in the target when the template is copied. ## Specify a JSON copy directive In the copy directive JSON (read [JSON examples for the Contract copy directive](/v1/docs/json-examples-for-the-copy-directives)), add a **sourceFilterField** key-value pair immediately following the source key-value pair for the JSON object that you want to be affected by this Boolean filter. ``` "objectsToInclude":[ { "source":"zpl__ContractLineItem__c", "sourceFilterField":"zpl_aiq_Type__c", "lookupField":"zpl__Contract__c", "iQAConfiguration":"", ```