Customer number (customer.number) is empty or wron...
# support
t
We have an assistant that does a lookup of the caller (in Hubspot) based on the {{customer.number}}, and personalizes the greeting if one record is found. It is rather straightfoward but has stopped working reliably. These are calls from a US mobile, to a number attached to a Vapi Assistant, which is configured to consume {{customer.number}}, store and normalize it as US 10-digit (no dashes), and apply in a tool for lookup. But it is now most often 1) hallucinating the customer.number or 2) finding it as blank / null. Please advice. See calls: - 019a001c-c5e7-7558-8f8f-01e29830088a - hallucinated a number from the prompt, not from the caller's customer.number - 019a0024-7585-7dd6-bc70-5d1ea9da03ea - had no caller number - 019a0018-d1a7-7668-a85b-5800f94db4b9 - hallucinated the caller number as 5551234567
c
Hi there, Thank you for your message. Our team is currently out of the office. We operate Monday through Friday, from 9:00 AM to 8:00 PM Pacific Standard Time (PST). We’ll get back to you as soon as possible during our normal business hours. If your message is urgent, please mark it accordingly or include “URGENT” in the subject line, and we’ll do our best to respond promptly. Warm regards, Vapi Customer Support Team
v
To reliably personalize by caller number, switch to server-side personalization by extracting the phone number from the webhook payload and passing it as a variable. Here’s a Node.js/Express example:
Copy code
js
app.post("/api/assistant-selector", async (req, res) => {
  if (req.body.message?.type === "assistant-request") {
    const phoneNumber = req.body.call.from.phoneNumber;
    const customer = await hubspotAPI.getCustomerByPhone(phoneNumber);
    res.json({
      assistantId: "your-assistant-id",
      assistantOverrides: {
        variableValues: {
          customerName: customer?.name || "valued customer",
          customerPhone: phoneNumber
        }
      }
    });
  }
});
This avoids LLM hallucination and ensures the actual caller number is used for lookups and personalization. Source: - [Personalization with user information](https://docs.vapi.ai/assistants/personalization)
t
Note: this call a few minutes ago did work as expected. Customer.number populated (from ANI / the number calling in), applied to lookup, found, personalized the greeting. Unfortunately, it's 1 out of 10 or so. - 019a0036-f828-7000-aacb-ff90bf99e6c6
v
Message marked as helpful by @GIDEON! 🎉
t
Question -- I'm reading some places that {{customer.phone}} is the right variable, not {{customer.number}}. Is that true?
Is customer.number old, and customer.phone preferred (with respect to dynamic variables)?
c
{{customer.number}} is the correct name for the default variable. If it is not passed in from the customers side then it will be blank and unavailable in the logs
2 Views