Skip to main content

mbr_compare

Usage

This shortcode determines the content to be included based upon a comparison of any two values using the specified comparison operator.

Parameters

ParametersDescription
value1The name of an ActiveCampaign contact field or contact field shortcode, or custom shortcode parameter or a hardcoded value, which will be compared to value2 based on the comparison operator. The available ActiveCampaign contact field names can be found in ActiveMember360, Utilities, Contact Fields. The lower case version of the Perstag should be used as the field name.
Defaults: none.
Required: yes.
cmpThe comparison operator, as listed below.
Default: none.
Required: yes.
value2The name of an ActiveCampaign contact field or contact field shortcode, or custom shortcode parameter or a hardcoded value, which will be compared to value1 based on the comparison operator. The available ActiveCampaign contact field names can be found in ActiveMember360, Utilities, Contact Fields. The lower case version of the Perstag should be used as the field name.
Default: none.
Required: yes.

The comparison operators are:

Operationcmp valueOrcmp value
equal==orEQ
not equal<>orNE
greater than>orGT
less than<orLT
greater than or equal>=orGE
less than or equal<=orLE
begins with~=orBW
ends with=~orEW
contains~~orCONTAINS

Validity

This shortcode is evaluated for any type of visitor.

Conditional Branching

[ELSE_compare] conditional branching is supported.

Nesting

Shortcode nesting is supported: [mbr_compare1] thru [mbr_compare19]
[ELSE_compare1] thru [ELSE_compare19]
[/mbr_compare1] thru [/mbr_compare19]

Examples

Display the value stored in the ActiveCampaign contact field named first_name for the logged in user preceded by the word "Hello" if that field is not empty. Otherwise display "Hello Friend.":

[mbr_compare value1='[mbr_db_first_name]' cmp='NE' value2='']
Hello [mbr_db_first_name].
[ELSE_compare]
Hello Friend.
[/mbr_compare]

API

info

There is currently no ActiveMember360 API function equivalent for this shortcode.