You are viewing limited content. For full access, please sign in.

Question

Question

Merge files w/same field name using workflow

asked on July 8

I have thousands of maps in one folder that have the same template applied. One of the fields is "Map Number" for which several files have the same map number. I want to create a workflow that will combine all files that have the same map number into one file, with the oldest "created by" file as page one - newer pages added after the oldest page. Then I want the files to be deleted after they have been merged with the original file. Most files only have two versions of the same map, but there are instances where there are multiple versions that will need to be added after pages two, three and so on. 

Can someone help me map out a workflow that can help me achieve the end goal of merging all these files with the same field data "Map Number" into one file with multiple pages?

 

Thanks in advance. :) 

0 0

Replies

replied on July 9

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:
    1. Template: Select your template from the dropdown.
    2. Field: Select your unique field name ➔ set to Equals ➔ click the Token button ( > ) and map the unique field token created in Step 2.
    3. 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:
    1. First Box: Click the Token button ( > ) and select Result Count from your Search Repository tokens.
    2. Dropdown Operator: Select Is greater than.
    3. 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:
    1. First Box: Select Current Iteration from your For Each Entry tokens.
    2. Dropdown Operator: Select Equals.
    3. 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:

  1. Starting Rule: Set to run on Entry Created when your template field is not empty.
  2. Retrieve Field Values: Captures the field value from the incoming document.
  3. Search Repository: Finds documents with matching fields, sorted by Entry ID (Ascending).
  4. Conditional Decision: Checks if Result Count is Is greater than 1.
  5. For Each Entry: Processes the search results.
  6. Find Entry (Inside Loop): Opens up the targeted entry.
  7. Conditional Decision (Inside Loop): Checks if Iteration Equals 1.
  8. Move Pages (Inside Iteration 1 Branch): Merges pages from Starting Entry to Find Entry -> Output Entry.
  9. 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.
0 0
replied on July 9

Thanks for taking the time to put this outline together! I modified it slightly as I want to manually run this workflow instead of using a starting rule. I double checked that everything is configured as described. When I run the workflow, the error I get back is at the "Move Pages" step. See attached for how I setup the Move Pages activity as well as a bird's eye view of my workflow. The error I get at the Move Pages step is "No entry was specified. [0263-WF1]"

 

The first "Search Repository" just points to the folder that holds the files where duplicates need to be merged. The second "Search Assessor Map Folder" activity is configured to find files with the applied template and that the file type is document. 

 

I am grateful for the above detailed, step-by-step directions. I am sure I'm close ... just keep getting an error. 


Other things to note: I did generate pages for all files, but some are TIFF and some are PDF. See third attachment for screenshot of files. I'm trying to merge files with identical "Map Number" fields. 

 

Any other thoughts? 

Move Pages Error.png
Workflow Snapshot.png
Sample Files.png
Sample Files.png (197.78 KB)
0 0
replied on July 9 • Show version history

Hello Jennifer,

I did a quick search of the error and  I got the following.  (I can send you my own workflow file. Share email for me to send to you so you can study that and compare.)

In Laserfiche Cloud, the "No entry was specified. [0263-WF1]" error means your Move Pages activity is pointing to an empty or unresolved token. [1, 2, 3]

In the cloud Process Automation platform, this usually happens because of how the cloud workflow is triggered or how loops are handled. [1, 2]

Step 1: Check the Activity Configuration

  1. Open your workflow in the Laserfiche Cloud Workflow Designer.
  2. Click on your Move Pages activity.
  3. Look at the Properties Pane on the right side under Move Pages From and Move Pages To.
  4. Ensure both fields contain valid tokens (e.g., %(StartingEntry_ID) or an ID token from a previous step). They cannot be blank. [1, 2, 3]

Step 2: Fix Based on Your Trigger Type

The root cause depends heavily on how your cloud workflow starts: [1, 2]

  • Scenario A: If using a Timer/Schedule Trigger
    • The Problem: Cloud workflows started by a schedule do not inherently have a "Starting Entry".
    • The Fix: You must place a Search Repository or Find Entry activity at the very beginning of your workflow. This locates your documents first and generates the proper entry tokens to feed into your Move Pages activity. [1, 2]
  • Scenario B: If using a "For Each Entry" Loop
    • The Problem: If you are iterating through a list of documents, the activity might accidentally be referencing the overall workflow start entry rather than the current item in the loop.
    • The Fix: Ensure the Move Pages From property uses the specific entry token generated by the For Each Entry loop activity, rather than the global starting entry token. [1]
  • Scenario C: If triggered by a Laserfiche Form
    • The Problem: When Laserfiche Forms uploads a document, the workflow might try to run before the cloud repository finishes registering the document ID.
    • The Fix: In your document creation activity, make sure the checkbox for "Output Entry" is enabled. This forces the workflow to remember the new document's token for the remaining steps. [1, 2]

Step 3: Verify "Laserfiche Pages" Exist

Laserfiche cannot move pages on native files (like Word docs or raw PDFs) unless image pages have been generated. If your workflow targets a document without actual TIFF image pages, the activity fails because it sees "zero pages" to move. Ensure you run a Generate Pages activity on the file prior to moving them. [1, 2, 3]

0 0
replied on July 10

" No entry was specified. [0263-WF1]" happens because you used the starting entry. Since you are running this workflow manually, there is no starting entry. You need to use the current entry from the outer For Each Entry. 

Side notes:

Find Entry where you set  Current Entry -> Entry ID is unnecessary. You can use the Current Entry directly in Move Pages. 

" 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." - this is not guaranteed to exclude the document that started this workflow. If 2 entries with the same field ID are created in a short amount of time, the search might return them both and the earlier one would not be the top one. It is safer to check whether the current entry ID equals the starting entry ID.

 

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.