Skip to main content
The User object lets you query information about the contact interacting with your flow, such as their name, phone number, and channel metadata.

Available data

The available data depends on the channel, but a typical example is:

Using user variables

You can access any user property with the syntax {{$user.property}}:
  • {{$user.id}} shows the user’s unique identifier for the channel.
  • {{$user.names}} shows the user’s name.
  • {{$user.phone}} shows the contact’s phone number. This is the field to use whenever you need the phone.
In channels like WhatsApp, the phone number comes without symbols or spaces. For example, +1-555-111-2222 is represented as 15551112222.

The phone number lives in phone, not in id

WhatsApp no longer guarantees the phone number as a stable identifier and is moving to its own identifier, the BSUID. That means {{$user.id}} can carry a BSUID instead of a number, so don’t use it as a phone number.
  • For the phone number, use {{$user.phone}}. It returns the contact’s real number, even when the conversation arrives identified by BSUID.
  • {{$user.phoneNumber}} is an alias of {{$user.phone}} and returns the same value. It stays available for flows that already use it, but we recommend migrating to phone.
  • Both can come back empty when no phone number can be resolved for that contact. Handle that case in your flows before using the value.
  • {{$user.id}} is still the contact’s identifier on the channel, and it is what you should use to reference them. It simply stopped always being a phone number.

User in code nodes

Inside code nodes, you have the User object available through $user:
The User object is read-only. If you want to persist new contact information, save that data in Memory or Context.