Hi everyone,
I am working in Laserfiche Cloud 12 and would appreciate guidance on how to conditionally insert or update records in a lookup table based on values entered in a form table within a Business Process.
Current Setup
1. Form Table (Business Process Form)
I have a form table with the following columns:
-
Item Name
-
Quantity as Qty
-
Unit Cost
-
Total (Qty multiplied by Unit Cost)
-
Balance
Each row represents a single stock item entered by the user.
2. Master Inventory Lookup Table
I have created a Master Inventory lookup table with the following fields:
-
Item Name
-
Balance at Hand
-
Last Restock Date
This table represents the current stock inventory.
3. Select Rule on the Form Table
A Select rule is applied to the Item Name field in the form table:
-
When a user enters or selects an Item Name, the rule checks the Master Inventory lookup table
-
If a match is found:
-
The Balance field in the form table is auto-populated using Balance at Hand
-
-
If no match is found:
-
The Balance field remains blank
-
4. Lookup Table Queries
I have already created two lookup table queries:
-
Insert query – for adding new items
-
Update query – for modifying existing items
5. Workflow Design
In my workflow, I currently have three Run Rule activities:
-
A Run Rule that inserts data from the form table into the Master Inventory lookup table
-
A Run Rule that updates the Master Inventory lookup table using values from the form table
-
A Run Rule that inserts data from the form table into a Stock In Table. This table displays all items that have been stocked into the inventory. It will be used to create Stock In Reports
The Problem
I want the workflow to execute conditionally for each row in the form table, depending on whether the item already exists in the Master Inventory lookup table.
Required logic:
-
If the item is new
(i.e., no match in the Master Inventory lookup table and the Balance field is blank)
→ Insert the item into the lookup table -
If the item already exists
(i.e., the Balance field is populated from the Master Inventory)
→ Update the existing record
→ Specifically update Balance at Hand using the value from the Balance field in the form table
What I Need Help With
-
How can this conditional logic be implemented correctly in Laserfiche Cloud 12 workflows?
-
What is the recommended way to evaluate this condition per form table row?
-
When using Run Rule activities, how do I decide whether to execute the Insert query or the Update query for each row?
Any Laserfiche Cloud 12–specific guidance, best practices, or examples would be greatly appreciated.
Thank you in advance for your help.