Designing a tour that survives an empty search result
Keep the tour valid when the list is empty
A tour that points at the first row of a search result breaks the moment the result set is empty. Design the step around the empty state instead: target the message or the "clear filters" control that is always present, and put the row-specific step behind a condition that only runs when a row exists.
Write two variants of the same step
Keep the copy identical in intent, but change the target. The empty variant explains why nothing is showing and offers the next action; the populated variant points at the first record. Both variants should resolve to the same completion event, so the finish count stays comparable.
Sample step entry
Step 2 — Review a result
If [data-test="result-row"] exists:
target: [data-test="result-row"]:first-of-type
Else:
target: [data-test="empty-search"]
copy: "No matches yet. Clear a filter to see results."
Done when: page /search visited OR event result_opened
Illustrative check. With the filter set to a date range holding no records, the old step aimed at a row that was not there and the tooltip sat over the sidebar. The variant above landed on the empty-state panel, and the tester cleared one filter and produced the result_opened event, which ticked the step.
Guard the exception
If the search call errors rather than returning zero rows, do not show either variant. Set the page rule to exclude the error banner state, and let the person retry from the search form. The step should not mark itself done on an error page, or the completion count will include people who never saw a result.
Related: Onboarding Tours features.
