You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
You are viewing the article in preview mode. It is not live at the moment.
Home > HappyFox Help Desk > Tips and Tricks > Prepopulate contact fields using URL parameters
Prepopulate contact fields using URL parameters
print icon

HappyFox allows you to pre-fill contact fields such as name, e-mail and phone during ticket creation from the agent panel by passing these as parameters in the URL. 

How this works:

Contact Fields have a URL parameter associated with it:

Contact Field Parameter
Full name contact_name
Phone Number contact_phone
Email Address contact_email

You would need to pass the contact field values inside the URL as parameters and hit enter:

https://<yourhelpdeskdomain>/staff/ticket?contact_phone=1212141&contact_email=benoit@chris.com&contact_name=chris%20benoit

Note: Contact custom fields cannot be passed as parameters at the moment.

 

Scenarios:


1. When the URL has only contact_email => contact is searched with email and the resulting contact is prepopulated in the new ticket form.
2. When the URL has only contact_phone => contact is searched with phone number and the resulting contact is prepopulated in the new ticket form as:
    2.1 If only 1 contact is returned, it will be prepopulated automatically.,
    2.2 If more than 1 contact is returned (When the phone number is not unique), then we check which contact has the passed phone number as its primary number and then prepopulate that contact.
    2.3.If multiple contacts have this as the primary number, then we don't prepopulate any contact.
3. When the URL has both contact_email and contact_phone, we search the contact using only email (email has higher precedence) and if any contact is returned, then the contact details will be loaded in the new ticket form. A point to note here is when loading the contact fetched, only the primary phone number is loaded in the phone number field. So sometimes, the passed phone number (in the URL may not be pre-filled in the form UI)
4. In addition to these query params, contact_name is also possible which will be pre-filled only if no contact matches when searching with email or phone number. Otherwise, the contact name from the selected contact will be pre-filled.

Feedback
1 out of 1 found this helpful

scroll to top icon