Filter eligible purchase order lines
Recipe ToolsWorkatoDeveloper ToolMarketing
What it does
When a function call arrives, this automation filters purchase orders to find items that match the request and have accepted collaboration status. It returns only those items that are not yet completed so the next step knows which ones to process.
Who it's for
Procurement teams who need to identify which purchase order lines are ready to process without manual review.
How teams use this
Route orders to fulfillment
Identify which purchase order lines are ready to ship by filtering for accepted collaboration status and incomplete progress. Pass the eligible items to a fulfillment system so the team ships only what is approved.
Notify finance of pending invoices
Find purchase order lines that match a vendor and have accepted status so finance can prepare invoices. Only items not yet completed are included, so the team knows which ones to bill.
Add budget check before processing
Extend the filter to include a budget availability check so only purchase order lines within budget limits are marked eligible. Set a condition that compares the remaining amount against available funds.
How it works
- Receive the function call. A function call arrives with the item code to match against purchase orders in the system.
- Loop through purchase order items. Workato Custom Code iterates through each purchase order item to check if the item code matches, collaboration status is accepted, and progress status is not completed.
- Calculate remaining quantity. For each eligible item, Workato Custom Code runs Ruby code to compute how much of the order remains to be fulfilled based on current progress.
- Return the eligible list. Workato Custom Code sends back the filtered purchase order lines so downstream steps can process only the items that meet all conditions.