DEV Community

bulldo.gs
bulldo.gs

Posted on Edited on

One wrong route in seven, twice: testing a Google Forms intake rule

What should an event form do with “No issue with the projection screen today”? A nearest-example classifier routes it to AV. A person reading the sentence sees that nobody needs to repair a screen.

Here is a small rehearsal you can run before deciding whether a Sheets intake tool should suggest a team. It uses 18 fictional support requests and a four-label reference key. AV covers projection and sound, IT covers networking and accounts, Room covers layout and furniture, and Review covers ambiguity, several teams, or no actionable request.

Run the smallest counterexample first

Open the routing exercise and editable worksheet. Select case 17. Its reference label is Review. One method finds no team keyword and holds it. The second matches words like “projection” and “screen” against an AV example. Its preprocessing drops “no” and it suggests AV.

Now select case 15. The network works but the presentation has no sound. A rule that spots “network” sends it to IT. The nearest example captures enough of the presentation wording to suggest AV. This time the reference label is AV.

Make the scorecard distinguish holds from bad routes

Keep three cells for each row: the expected label in C, the suggestion in D and a verdict. With a complete reference and suggestion, the scoring formula is:

=IF(D2="Review","Review",IF(D2=C2,"Correct route","Wrong route"))
Enter fullscreen mode Exit fullscreen mode

A Review suggestion always enters the review count. If the reference is Review and the suggestion is AV, it enters the wrong-route count. The workbook additionally skips incomplete rows and breaks held requests into two groups depending on whether the reference already had a team.

Across all 18 requests, keywords made 6 correct team suggestions, 1 wrong suggestion and 11 holds. Nearest example made 12 correct team suggestions, 2 wrong suggestions and 4 holds. Comparing only team suggestions yields 1 wrong in 7 versus 2 in 14. Comparing all requests yields 1 in 18 versus 2 in 18. Pick the denominator appropriate to the staffing question. A coordinator needs the count of holds as well as the share of routed work a crew might have to untangle.

Put the custom function in a practice Sheet

Import the workbook as a Google Sheet. In Extensions → Apps Script, paste the custom function from the exercise and save. In the Cases tab, clear D2:E19 and enter this in D2:

=INTAKE_CHECK(B2:B19)
Enter fullscreen mode Exit fullscreen mode

The result spills into both columns. The first column looks for an unambiguous team among three keyword groups. The other compares token sets with 12 fixed examples using intersection size divided by union size. It holds the row if the best similarity is below 0.20 or the lead over the next team is below 0.10. The function returns suggestions and has no triggers or dispatch code.

Try adding a qualifier to the end of one fictional message. Set the reference label before you look at the suggestion. Which qualifier changes the routing decision? A fictional case is enough to discuss the test.

These 18 deliberately authored requests demonstrate specific failures. A real event desk would need its own reference set. The browser and workbook use the same published rules and the included SQL reproduces the fixed counts. Google’s custom function reference describes the range and return conventions.

This worked example was created by bulldo.gs with AI assistance. The walkthrough, fixed predictions and workbook scorecard were checked against the fictional cases.

Top comments (0)