Set Display Name
What does it do?
Sets the chat's displayName — a custom chat title stored on the chat, separate from the channel-provided title (which holds the WhatsApp profile name and is not changed by this node). Use it after collecting the customer's real name in the bot flow so agents see that name on the chat instead of (or alongside) the channel handle.
Accessible afterwards via %chat:displayName%. %chat:title% continues to return the original channel-provided name.
The value is trimmed and internal whitespace runs are collapsed to single spaces before being saved (e.g. " John Doe " becomes "John Doe"). If the normalized value matches the current displayName, the node is a no-op.
1. Syntax
<node_name>:
type: func
func_type: chat
func_id: setDisplayName
params:
displayName: "<new name>"
setOnlyIfEmpty: <boolean>
maxLength: <1-255>
onOverflow: "truncate" | "fail" | "skip"
on_complete: <next_node>
required params
typetype of the nodefunc_typehere it will be a chat functionfunc_idwhat function are we calling (setDisplayName)params.displayNamethe new display name. Empty string""clears the current value. Supports data injectionon_completenext node after complete
optional params
params.setOnlyIfEmptyiftrue, the update is skipped when the chat already has a non-emptydisplayName. Defaultfalseparams.maxLengthmax allowed length after whitespace normalization, integer between 1 and 255. Default255params.onOverflowwhat to do when the normalized value exceedsmaxLength. One of:"truncate"— cut tomaxLengthcharacters (default)"skip"— leave the existingdisplayNameunchanged and continue toon_complete"fail"— throw an error and route toon_failure
on_failurefallback node (used byonOverflow: "fail"and on invalid params)departmentassigns the chat to a departmentagentassigns the chat to a specific agent (email address or CRM ID as defined in the Texter agents manager)
2. Examples
Set display name from a collected first + last name
set_display_name:
type: func
func_type: chat
func_id: setDisplayName
params:
displayName: "%state:node.ask_first_name.text% %state:node.ask_last_name.text%"
on_complete: main_menu
Only set if the chat has no name yet
Useful when the WhatsApp profile name is already on the chat and you don't want to overwrite it with what the bot collected.
set_name_if_missing:
type: func
func_type: chat
func_id: setDisplayName
params:
displayName: "%state:node.ask_full_name.text%"
setOnlyIfEmpty: true
on_complete: main_menu
Set from CRM lookup, with a length cap
set_name_from_crm:
type: func
func_type: chat
func_id: setDisplayName
params:
displayName: "%state:node.lookup_customer.response.data.0.fullName%"
maxLength: 60
onOverflow: "truncate"
on_complete: continue_flow
Fail the node on overflow
Route to on_failure instead of silently truncating — e.g. so the bot can re-prompt for a shorter name.
set_name_strict:
type: func
func_type: chat
func_id: setDisplayName
params:
displayName: "%state:node.ask_full_name.text%"
maxLength: 40
onOverflow: "fail"
on_complete: confirm_name
on_failure: ask_shorter_name
Clear the display name
Pass an empty string to wipe the existing value.
clear_display_name:
type: func
func_type: chat
func_id: setDisplayName
params:
displayName: ""
on_complete: next_step
The new value is reflected immediately in %chat:displayName% for downstream nodes (notify messages, request bodies, email subjects). It does not change %chat:title% — that remains the channel-provided name.
setOnlyIfEmpty and the no-op-on-unchanged behavior make this safe to place at the top of a flow — it won't repeatedly overwrite the same value or clobber a name the agent set manually.