Recognising a caller by their phone number sounds trivial. In practice I hit four separate traps.
1. It’s not where you’d expect
On calls routed through Omnichannel, System.Activity.From.Id was a per-conversation GUID, not a phone number. The real number was in the Omnichannel customer-phone context variable.
2. It sometimes arrives wrapped in quotes
The caller value occasionally arrives with literal quote characters around it. Strip them defensively before any lookup, or your match rate quietly drops.
3. Graph filters can lie
A Graph $filter on mobilePhone returned zero matches for a user who definitely existed. Verify with a direct GET, or list and filter client-side.
4. Some channels don’t give you one at all
The Teams Phone Agent preview exposes no caller number at all. Plan the channel around that before promising “we’ll greet them by name”.
Takeaway
Treat caller ID as untrusted input. Normalise it, sanitise it, and test the lookup with real calls, not just the test pane.