Hello Jennifer
Follow the below guide to the letter. It will work. The instruction is for Laserfiche Cloud not On-Premise.
1. Set the Workflow Starting Rule
- Navigate to Process Automation > Workflows and create a new workflow.
- Configure a Starting Rule based on the Entry Created event.
- Add conditions so it only triggers when:
- Template Name ➔ Equals ➔ Select your template from the dropdown
- [Your Unique Field] ➔ Is not empty
2. Retrieve the Unique Field Value
- Drag a Retrieve Field Values activity into the designer loop.
- Set the starting entry as the source in the properties pane.
- Check the box next to your unique field name. This generates the background system token.
3. Configure the Visual Search Query
- Drag a Search Repository activity into the designer.
- Use the visual query builder to add these three precise conditions:
- Template: Select your template from the dropdown.
- Field: Select your unique field name ➔ set to Equals ➔ click the Token button ( > ) and map the unique field token created in Step 2.
- Entry Type: Set to Document.
- In the Search Options panel on the right side of the screen, set Sort by to Entry ID and direction to Ascending. This ensures that the oldest matching document in your repository lands in the first row of results.
4. Build the Visual Conditional Decision
- Drag a Conditional Decision activity below your search. It populates Branch 1 (left) and Branch 2 (right).
- Click on Branch 1 and open its condition editor:
- First Box: Click the Token button ( > ) and select Result Count from your Search Repository tokens.
- Dropdown Operator: Select Is greater than.
- Value Box: Type 1.
- Click on Branch 2. Leave its condition completely blank. Because it is empty, Laserfiche Cloud treats it as the default catch-all path. If no matching master document exists, the workflow exits safely here.
5. Loop and Convert Search Data to an Addressable Document
In Laserfiche Cloud, search results are treated as a raw data collection rather than actual entry objects. You must use a loop and look up the ID to make the master file visible to other tasks.
- Drag a For Each Entry activity directly into Branch 1.
- Set its input source properties to look at your Search Repository activity.
- Drag a Find Entry activity and drop it inside the For Each Entry loop container.
- Set it to find by Entry ID.
- Click the Token button ( > ) and choose the Current Entry -> Entry ID token generated by the loop.
6. Prevent Loop Multi-Execution (The Cloud Safety Check)
Because the Cloud version of the For Each Entry activity lacks a visual "limit iterations" checkbox, we add a quick execution cutoff:
- Drag an internal Conditional Decision activity inside the For Each Entry container, right beneath your Find Entry step.
- Open Branch 1 of this internal decision and configure it:
- First Box: Select Current Iteration from your For Each Entry tokens.
- Dropdown Operator: Select Equals.
- Value Box: Type 1.
- Leave Branch 2 completely empty. This workflow logic guarantees you only process the first (oldest) master document and then stop.
7. Execute the Page Merge and Cleanup
Drag your final two steps inside Branch 1 of that internal Conditional Decision:
- Move Pages
- Action: Select Move pages.
- Move Pages From: Keep this set to Starting Entry.
- Move Pages To: Select the Other entry radio button, click Edit, and choose Find Entry ➔ Output Entry from your workspace items.
- Page Range: Select All pages.
- Insert Pages: Choose After last page to sequence the newly imported pages behind the old ones.
- Delete Entry
- Target Entry: Select Starting Entry. This purges the empty shell file left behind.
⚠️ Critical Cloud Limitation: Page Generation
Laserfiche Cloud cannot merge flat electronic documents like raw PDFs, Word files, or spreadsheets. It requires physical image pages (TIFF layers).
To prevent this workflow from failing, verify your Cloud Import Profiles or Web Scanning options are configured to Generate Pages upon import.
Would you like to review how to configure those Generate Pages settings inside your Cloud Import Profile, or would you like to run the configuration through the Workflow Tester to watch it execute in real time?
You can completely ignore and leave the "Fields to Retrieve" section blank for this specific merging workflow.
In Laserfiche Cloud, checking boxes in the Fields to Retrieve section of a Search Repository activity tells the system to grab metadata values from the documents it finds. However, because Laserfiche Cloud treats search results as a raw dataset rather than addressable documents, selecting fields here will not generate tokens you can use directly in your downstream merging activities.
Instead, you handle metadata and entry targeting through the Find Entry activity we placed inside your loop.
Why You Don't Need It Here
- The Goal is a Page Merge: Your workflow only cares about locating the oldest document's Entry ID so it knows where to send the pages.
- Entry ID is Automatic: The search activity always retrieves basic properties like Entry ID and Result Count automatically. You do not need to configure anything in "Fields to Retrieve" to get those.
- Find Entry Does the Heavy Lifting: The Find Entry activity inside your loop handles the actual job of opening that specific master document so Laserfiche can write pages to it.
When Would You Use It?
You would only use that section if you needed to do something like read an "Amount Due" field from the search results to calculate a sum. Since we are just moving physical image pages from the new document into the old master document, you can safely skip configuring this section.
Important Technical Considerations
- Page Generation: Laserfiche Cloud cannot merge electronic files (like flat PDFs) unless they have physical image pages. Ensure your scan or import profile is set to Generate Pages upon import.
- Metadata Preservation: The Move Pages activity only transfers physical pages. The metadata values on the original master document will remain completely unchanged.
Final Check Before Launch
Before you publish, make sure your workflow steps follow this exact cloud-verified blueprint:
- Starting Rule: Set to run on Entry Created when your template field is not empty.
- Retrieve Field Values: Captures the field value from the incoming document.
- Search Repository: Finds documents with matching fields, sorted by Entry ID (Ascending).
- Conditional Decision: Checks if Result Count is Is greater than 1.
- For Each Entry: Processes the search results.
- Find Entry (Inside Loop): Opens up the targeted entry.
- Conditional Decision (Inside Loop): Checks if Iteration Equals 1.
- Move Pages (Inside Iteration 1 Branch): Merges pages from Starting Entry to Find Entry -> Output Entry.
- Delete Entry (Inside Iteration 1 Branch): Cleans up the empty Starting Entry.
For this specific workflow to work, every document you want to merge must have the exact same value typed into that unique template field.
Here is exactly how the workflow uses that value to find a match:
- The Link: The Search Repository activity uses that field value as its search hook. It looks through your repository and says, "Find me every document where Invoice Number equals 12345."
- The Result: If a newly scanned document has 12345 and an older document already in the system has 12345, the search count becomes 2. This triggers your Conditional Decision to run the merge.
- The Catch: If there is even a tiny difference—such as an extra space (12345 vs 12345) or a typo—the search count will only be 1 (finding only itself). The workflow will then follow your empty default branch and exit without merging.