Creating a Rule
Mod AI gives you two ways to create rules: a structured rule builder where you define conditions and actions manually, and a natural language option where you describe what you want in plain English and the AI generates the rule for you.
Two Ways to Create Rules
Structured Rules (Manual)
Structured rules give you precise control. You define exactly which conditions must be met and exactly what actions to take. This is best when you need fine-grained logic, multiple conditions, or specific operator comparisons.
Natural Language Rules
Natural language rules let you describe what you want in everyday English. The AI interprets your description and generates the appropriate conditions and actions. This is best for straightforward rules that are easy to express in words.
Start with natural language rules for simple cases. Use structured rules when you need precise control over operators, thresholds, or complex condition logic.
Creating a Structured Rule
Follow these steps to build a rule using the structured rule builder:
- Go to Rules in the left sidebar.
- Click Create Rule.
- Name your rule. Use a clear, descriptive name (e.g., "Code Staples to Office Supplies").
- Choose scope. Select whether this rule is Global (applies to all invoices) or Vendor-specific (applies only to a specific vendor). If vendor-specific, search for and select the vendor.
- Add conditions. Define when the rule should trigger. Click Add Condition, choose a field, select an operator, and enter a value. You can add multiple conditions -- all must be true for the rule to fire. See Rule Conditions & Actions for all available condition types.
- Add actions. Define what the rule should do when triggered. Click Add Action, choose an action type, and configure it. You can add multiple actions -- all will execute when conditions are met.
- Set priority. Enter a priority number. Lower numbers are evaluated first. See How Rules Work for details on priority ordering.
- Save and activate. Click Save to create the rule. It takes effect immediately on new invoices.
Creating a Natural Language Rule
Follow these steps to create a rule using natural language:
- Go to Rules in the left sidebar.
- Click Create Rule.
- Choose Natural Language.
- Type your instruction. Describe what you want the rule to do in plain English. For example:
- "Automatically code all FedEx invoices to account 5300 Shipping"
- "Flag any invoice over $10,000 for manual review"
- "Set the department to Marketing for invoices containing 'marketing' in the description"
- Review the AI-generated rule. The AI translates your description into structured conditions and actions. Check that they match your intent -- verify the fields, operators, values, and actions are correct.
- Confirm or edit. If the generated rule looks correct, click Confirm to activate it. If something needs adjustment, click Edit to modify the conditions or actions before saving.
AI-generated rules always require your confirmation before they take effect. The AI will never activate a rule on its own.
Learn More
- Rule Conditions & Actions -- Every condition type and action type explained.
- Managing Rules -- Edit, reorder, enable, disable, and delete rules.