Conditional Routing
Route form submissions to different Google Sheet tabs or entirely different spreadsheets based on field values. Set up rules with match operators, priorities, and fallback destinations.
Creating Routing Rules
Setting up conditional routing takes just a few clicks. Each rule defines a condition and a destination - when a submission matches the condition, it is sent to that destination.
Open your sync rule settings
Go to SheetLink -> Settings in your WordPress admin and click the edit icon on the sync rule you want to add routing to.
Find the Conditional Routing section
Scroll down past the field mapping area. You will see the "Conditional Routing" section below.
Add a route
Click "+ Add Route" to create a new routing rule. Each rule has four parts:
- Field - select the form field to evaluate from the dropdown of available fields
- Operator - choose a match operator (equals, contains, starts_with, etc.)
- Value - enter the value to match against
- Destination - set either a tab name in the same sheet, or a completely different Google Apps Script URL
Set the priority
Assign a priority number to each rule. Lower numbers are evaluated first. We recommend using increments of 10 (e.g. 10, 20, 30) so you can insert new rules between existing ones later.
Save
Click Save. Your routing rules are now active. Every new form submission will be evaluated against these rules before being sent to Google Sheets.
Match Operators
SheetLinkWP provides ten match operators to cover a wide range of routing conditions. All string comparisons are case-insensitive.
| Operator | Description | Example |
|---|---|---|
equals |
Exact match (case-insensitive) | service equals roofing |
not_equals |
Does not match | source not_equals internal |
contains |
Substring match | message contains urgent |
not_contains |
Does not contain substring | email not_contains test |
starts_with |
Starts with prefix | phone starts_with +1 |
ends_with |
Ends with suffix | email ends_with @gmail.com |
greater_than |
Numeric comparison | budget greater_than 5000 |
less_than |
Numeric comparison | budget less_than 1000 |
is_empty |
Field is empty or missing | company is_empty |
is_not_empty |
Field has a value | phone is_not_empty |
Note
The greater_than and less_than operators compare values numerically. If the field value is not a valid number, the rule will not match and evaluation continues to the next rule.
Priority & First-Match
Rules are evaluated in priority order (lowest number first). The first matching rule wins - subsequent rules are skipped entirely. This is known as "first-match" routing.
- Rules with lower priority numbers are evaluated first (priority 10 runs before priority 20)
- The first rule that matches determines the destination - no further rules are checked
- If no rules match, the submission goes to the default destination
- If two rules have the same priority number, the one created first is evaluated first
Tip
Use priority numbers like 10, 20, 30 (not 1, 2, 3) so you can easily insert new rules between existing ones. Need a rule between 10 and 20? Just set its priority to 15.
Default Destination
Every sync rule has a default destination - the main Receiver URL and optional default tab that you configured when you first created the rule. This is the fallback for all submissions.
- If no routing rules match the submission, it goes to the default destination
- The default is always used as a fallback, so no submission is ever lost
- You do not need to create a routing rule for the default case - it is automatic
No data loss
Even if all your routing rules fail to match, the submission still arrives in your default Google Sheet. No data is lost.
Example Use Cases
Here are a few real-world examples to show how conditional routing can be used.
Service-Based Routing
A roofing company routes leads by service type:
serviceequalsresidential-> Residential Leads tabserviceequalscommercial-> Commercial Leads tab- Default -> General Inquiries tab
Geographic Routing
A multi-location business routes by zip code:
zipcodestarts_with90-> Los Angeles Sheetzipcodestarts_with10-> New York Sheet- Default -> National Sheet
Priority Lead Detection
Route high-value leads to a separate sheet:
budgetgreater_than10000-> High Value tabmessagecontainsurgent-> Urgent tab- Default -> Standard Leads tab
Spam Filtering
Keep test and spam submissions separate:
emailends_with@test.com-> Test Submissions tabemailcontainsspam-> Spam tab- Default -> Real Leads tab
Testing Routes
After creating your routing rules, always test them before relying on them for live submissions.
Send a test submission
Click the "Test" button on your sync rule to send sample data through the routing engine. You can modify the test data to trigger different routing rules.
Check the Delivery Log
Go to SheetLink -> Log to see the delivery log. For each submission, the log shows:
- Destination URL - which Google Apps Script received the data
- Tab name - which sheet tab the data was written to
- Matched rule - which routing rule was matched, or "default" if no rules matched
Verify in Google Sheets
Open your Google Sheet and confirm the test data landed in the correct tab. Try different test values to exercise each of your routing rules and make sure the default fallback works too.
Tip
Test your default destination too. Send a submission that doesn't match any routing rule to confirm it lands in the correct fallback sheet.
Next Steps
Ready to Get Started?
Install SheetLink Forms and connect your first form in under 10 minutes.