gwp_user
The gwp_user
merge tag allows for the dynamic retrieval of user information based on the current user’s properties.
Functionality
This merge tag can extract various user properties, such as username, email, and more, directly into your forms or notifications. It ensures sensitive information, like passwords, is handled securely by preventing such data from being displayed.
It is similar to the Gravity Forms {user} merge tag, but {gwp_user} allows using additional merge tag modifiers, making it more powerful.
Usage
To use the gwp_user
merge tag, specify the desired user property in the tag itself, followed by any modifiers if needed. The basic syntax is as follows:
{gwp_user:property}
Where property
is the user attribute you wish to display.
Supported User Properties
User Property | Mergetag |
---|---|
User ID | {gwp_user:ID} |
User login | {gwp_user:user_login} |
User email | {gwp_user:user_email} |
Display name | {gwp_user:display_name} |
First name | {gwp_user:first_name} |
Last name | {gwp_user:last_name} |
Custom Property | {gwp_user:custom_property} |
Modifiers
Modifiers can be appended to further manipulate the output, such as sanitizing text or changing the format. These are specified after the property, separated by a colon:
{gwp_user:property:modifier}
We’ll give you a few examples how to use it with Advanced Merge Tags modifiers.
Output | gwp_user merge tag and modifier example |
---|---|
First name in all capitals using the gwp_case modifier | {gwp_user:first_name:gwp_case to=upper} |
Counting all the Gravity Forms entries with the users e-mailaddress in a field with gwp_count_matched_entries, for example count all entries in Form ID 5 where Field ID 2 is the user e-mail. | {gwp_user:user_email:gwp_count_matched_entries form_id=5 match_id=2} |
Sanitize the User Display Name with the gwp_sanitize modifier | {gwp_user:display_name:gwp_sanitize type="sanitize_text_field"} |
URL Encode the users Display Name with gwp_urlencode | {gwp_user:display_name:gwp_urlencode} |
Getting a value from an Entry with matching e-mailaddresses with gwp_get_matched_entry_value, for example give me back the value of Field ID 10 in Form ID 5 where the user e-mail is in matching Field ID 2 | {gwp_user:user_email:gwp_get_matched_entry_value form_id=5 match_id=2 return_id=10} |
Last updated: 06-05-2024