Form Field Code Structure

Fluent CRM has a cool structural format for generating form fields. Using this structural format anyone can make a form without writing any HTML or JavaScript. The form fields will depend on the structural format.

There are several types of form fields in Fluent CRM and all those have almost the same structural format. There are 26 types of form fields in fluent CRM. There are also some common and optional fields in every form block. Let’s look at first the common/optional fields

KeyDescription
labelLabel title of your form field
inline_helpHelp message below your form input
placeholderPlaceholder of the selector
helpDescription about selector
wrapper_class(Optional) With this property, someone can customize the form block design.
readonly(Optional) If this property is true, then the field will be read-only
dependency

Option selectors

'subscription_status' => [
    'type'        => 'option_selectors',
    'option_key'  => 'editable_statuses',
    'is_multiple' => false,
    'label'       => 'Subscription Status',
    'placeholder' => 'Select Status'
]

This is a simple option_selectors type field component, you can find this structure in every integration. The option_key is used to get the correct options from WordPress. The is_multiple defines whether the option selector is multiple or not.

KeyDescription
creatableCan the user create a new tag/list
size(Optional) Size of the field
option_keyDynamic Data Sets: Possible Values – See bellow
is_multipleIf the selector is multiple or not

Option Key possible sets.

KeyDescription
tagsTags are like Lists but more ways to filter your contacts inside a list.
listsList are categories of your contacts.
editable_statusesAll editable statuses of a user
woo_productsAll woo-commerce products
email_sequencesAll sequences of Fluent-CRM
campaignsAll campaigns of Fluent-CRM
product_selector_tutorlmsAll courses of TutorLMS
edd_couponsAll coupons of Easy Digital Download
product_selector_learndashAll options of Learndash courses
product_selector_learndash_groupsAll options of Learndash groups
product_selector_lifterlmsAll options of LifterLMS courses
product_selector_lifterlms_groupsAll options of LifterLMS memberships
product_selector_pmproAll memberships of Paid Membership Pro
product_selector_rcpAll memberships of Restrict Content Pro
product_selector_wishlistAll memberships of Wishlist Member
woo_couponsAll Woo-commerce coupons
woo_order_statusesAll Woo-commerce order statuses
woo_categoriesAll Woo-commerce categories
product_selector_wooAll Woo-commerce products
product_selector_woo_orderAll Woo-commerce products
edd_productsAll Easy Digital Download products
product_selector_eddAll Easy Digital Download products

The preview of the example block.

screenshot 2022 09 01 at 11.57.47 am

Single or multi-select

'product_ids'     => [
    'type'        => 'multi-select',
    'label'       => 'Target Products',
    'help'        => 'Select for which products this goal will run',
    'options'     => [
          [
                'id'    => '2',
                'title' => 'First Product'
          ]
    ],
    'inline_help' => 'Keep it blank to run to any product purchase',
],

This is an example multi-select type field component, you can find this structure in every integration. The options property contains the options of the select field. The structure of single select and multi-select is the same. Every option has two properties, id & title.

The preview of the example block.

screenshot 2022 09 01 at 2.47.57 pm

Options possible sets:

KeyDescription
idset selector id
titleset selector title

Radio

'purchase_type'      => [
    'type'        => 'radio',
    'label'       => 'Purchase Type'
    'help'        => 'Select the purchase type',
    'options'     => [
        [
            'id'    => 'all',
            'title' => 'Any type of purchase'
        ]
    ],
    'inline_help' => 'For what type of purchase you want to run this goal'
],

This is an example radio type field component, you can find this structure in every integration. The options property contains the values of the radio fields. Every option has two properties, id & title.

Options Key possible sets:

KeyDescription
idSet selector id
titleSet selector title

The preview of the example block.

screenshot 2022 09 01 at 3.10.51 pm

Number input

'wait_time_amount' => [
    'label'         => 'Wait Time',
    'type'          => 'input-number',
    'wrapper_class' => 'fc_2col_inline pad-r-20'
],

This is an example input-number type field component, you can find this structure in every integration. There are also some optional properties.

The preview of the example block.

screenshot 2022 09 01 at 3.22.58 pm

Text input

'send_email_custom'  => [
    'wrapper_class' => 'fc_half_field',
    'type'          => 'input-text',
    'label'         => 'Send To Email Addresses (If Custom)',
    'placeholder'   => 'Custom Email Addresses',
    'inline_help'   => 'Use comma separated values for multiple'
]

This is an example input-text type field component, you can find this structure in every integration.

The preview of the example block.

screenshot 2022 09 01 at 3.30.03 pm 1

Text input popper

'note'      => [
    'type'       => 'input-text-popper',
    'field_type' => 'textarea',
    'label'      => 'Order Note',
    'help'       => 'Type the note that you want to add to the reference order. You can also use smart tags'
]

This is an example input-text-popper type field component, you can find this structure in every integration. The possible value of the field_type property is text or textarea.

The preview of the example block.

screenshot 2022 09 01 at 3.50.01 pm

Yes & no check

'run_multiple'       => [
    'type'        => 'yes_no_check',
    'label'       => '',
    'check_label' => 'Restart the Automation Multiple times for a contact for this event. (Only enable if you want to restart automation for the same contact)',
    'inline_help' => 'If you enable, then it will restart the automation for a contact if the contact already in the automation. Otherwise, It will just skip if already exist',
]

This is an example yes_no_check type field component, you can find this structure in every integration.

The preview of the example block:

screenshot 2022 09 01 at 3.54.18 pm

Grouped select

'lesson_ids'      => [
    'type'        => 'grouped-select',
    'label'       => 'Target Lessons',
    'help'        => 'Select for which Lessons this automation will run',
    'options'     => [
          [
               'title'   => 'First Course',
               'slug'    => 'first_course',
               'options' => [
                     [
                         'id'    => '1'
                         'title' => 'First Lesson'
                     ]
               ]
          ]
    ],
    'is_multiple' => true,
    'inline_help' => 'Keep it blank to run to any Lesson',
],

This is an example grouped-select type field component, you can find this structure in every integration. The options property contains a list. Every option has three properties title, slug & options(Every options of this property contains two fields named id & title).

Options possible sets:

keyDescription
titleset course title
slugset course slug
optionsDynamic Data sets: Possible Values – See below

Options -> Options possible sets:

KeyDescription
idset selector id
titleset selector title

The preview of the example block.

screenshot 2022 09 01 at 4.33.13 pm

Multi text options

'target_lesson' => [
    'type'        => 'multi_text_options',
    'label'       => 'Target lessons',
    'help'        => 'Select target lessons',
    'input_type'  => 'text',
    'placeholder' => 'Target lessons',
    'inline_help' => 'Keep it blank to run all lessons'
]

This is an example multi_text_options type field component, you can find this structure in every integration.

The preview of the example block.

screenshot 2022 09 02 at 12.34.30 pm

Email campaign composer

'campaign'  => [
    'label' => '',
    'type'  => 'email_campaign_composer'
],

This is an example email_campaign_composer type field component, you can find this structure in every integration.

The preview of the example block.

screenshot 2022 09 02 at 9.27.07 am

Reload field selection

'course_id'       => [
    'type'        => 'reload_field_selection',
    'label'       => 'Target Course',
    'help'        => 'Select Course to find out Lesson',
    'options'     => [
          [
              'id'    => '1',
              'title' => 'First Course'
          ]
     ],
    'inline_help' => 'You must select a course'
],

This is an example reload_field_selection type field component, you can find this structure in every integration. The options property contains a list. Every option has two properties named id & title.

The preview of the example block.

KeyDescription
idset selector id
titleset selector title

The preview of the example block.

screenshot 2022 09 02 at 9.38.23 am

Form group mapper

'primary_fields'        => [
    'label'             => 'Map Primary Data',,
    'type'              => 'form-group-mapper',
    'value_options'.    => [
        [
            'id'    => '',
            'title' => ''
        ]
    ],
    'local_label'      => 'Contact Field (CRM)',
    'remote_label'     => 'Form Field',
    'fields'           => [
        'first_name' => [
               'type'   => 'value_options',
               'label'  => 'First Name'
        ],
        'last_name' => [
              'type'   => 'value_options',
              'label'  => 'Last Name'
        ],
        'email'    => [
            'type'    => 'value_options',
            'label'   => 'Email'
        ]
    ]
]

This is an example form-group-mapper type field component, you can find this structure in every integration. The value_options property contains a list of options of Fluent Form. Every option has two properties named id & title.

There is also a property named fields which contains a list of input fields.

The preview of the example block.

screenshot 2022 09 02 at 2.18.05 pm

Form many dropdown mappers

'other_fields'           => [
    'label'              => 'Map Other Data',
    'type'               => 'form-many-drop-down-mapper',
    'value_options'      => [
        [
            'id'    => '',
            'title' => ''
        ]
    ],
    'local_label'        => 'Select Contact Property',
    'remote_label'       => 'Select Form Field',
    'local_placeholder'  => 'Select Contact Property',
    'remote_placeholder' => 'Select Form Property',
    'fields'             => [
            'prefix'         => [
                'type'  => 'value_options',
                'label' => 'Name Prefix'
            ],
            'address_line_1' => [
                'type'  => 'value_options',
                'label' => 'Address Line 1'
            ],
            'address_line_2' => [
                'type'  => 'value_options',
                'label' => 'Address Line 2'
            ],
     ]
]

This is an example form-many-drop-down-mapper type field component, you can find this structure in every integration. The value_options property contains a list of options of Fluent Form. Every option has two properties named id & title.

There is also a property named fields which contains a list of input fields.

The preview of the example block.

screenshot 2022 09 02 at 3.20.53 pm

Html

'subscription_status_info' => [
    'type'       => 'html',
    'info'       => 'An Automated double-optin email will be sent for new subscribers',
]

This is an example html type field component, you can find this structure in every integration. The info property is required.

Url selector

'redirect_to' => [
    'type'        => 'url_selector',
    'label'       => 'Redirect To',
    'placeholder' => 'Your Target URL',
    'help'        => 'Contacts will be redirected to this link.',
    'inline_help' => 'Please provide the url to where the contact will be redirected'
],

This is an example url_selector type field component, you can find this structure in every integration.

The preview of the example block:

screenshot 2022 09 02 at 10.03.21 am

Input value pair properties

'contact_properties'     => [
    'type'               => 'input_value_pair_properties',
    'support_operations' => 'yes',
    'label'              => 'Setup contact properties that you want to update',
    'data_key_label'     => 'Contact Property',
    'data_value_label'   => 'Property Value',
    'property_options'   => [
         'contact_type'  => [
             'label'     => 'Contact Type',
             'type'      => 'select',
             'options'   => [
                  [
                      'id'    => 'lead',
                      'slug'  => 'lead',
                      'title' => 'Lead'
                  ]
             ]
         ],
    ]
]

This is an example input_value_pair_properties type field component, you can find this structure in every integration. The property_options property contains a list of other different types of field components.

property_options possible sets:

keyDescription
labelset selector label
typeset selector type
optionsDynamic Data Sets: Possible Values – See below

property_options -> options possible sets:

keyDescription
idset selector id
slugset selector slug
titleset selector title

The preview of the example block.

screenshot 2022 09 02 at 10.48.35 am

Text value multi properties

'meta_properties'            => [
    'label'                  => 'User Meta Mapping',
    'type'                   => 'text-value-multi-properties',
    'data_key_label'         => 'User Meta Key',
    'data_value_label'       => 'User Meta Value',
    'data_value_placeholder' => 'Meta Value',
    'data_key_placeholder'   => 'Meta key',
    'help'                   => 'If you want to map user meta properties you can add that here. This is totally optional',
    'value_input_type'       => 'text-popper'
],

This is an example text-value-multi-properties type field component, you can find this structure in every integration.

screenshot 2022 09 02 at 11.07.51 am

Html editor

'description' => [
    'type'    => 'html_editor',
    'label'   => 'Description'
]

This is an example html_editor type field component, you can find this structure in every integration.

The preview of the example block.

screenshot 2022 09 02 at 11.18.21 am

Rest selector

'course_id' => [
    'type'        => 'rest_selector',
    'option_key'  => 'product_selector_learndash',
    'is_multiple' => false,
    'clearable'   => true,
    'label'       => 'Select Course to Enroll',
    'placeholder' => 'Select Course',
]

This is an example rest_selector type field component, you can find this structure in every integration. The option_key is a required property.

screenshot 2022 09 02 at 11.31.02 am

Condition block groups

'conditions' => [
    'type'        => 'condition_block_groups',
    'label'       => 'Specify Matching Conditions',
    'inline_help' => 'Specify which contact properties need to matched. Based on the conditions it will run yes blocks or no blocks',
    'labels'      => [
        'match_type_all_label' => 'True if all conditions match',
        'match_type_any_label' => 'True if any of the conditions match',
        'data_key_label'       => 'Contact Data',
        'condition_label'      => 'Condition',
        'data_value_label'     => 'Match Value'
    ],
    'groups'      => [
            'subscriber' => [
                'label'    => 'Contact',
                'value'    => 'subscriber',
                'children' => [
                    [
                        'label' => 'First Name',
                        'value' => 'first_name',
                        'type'  => 'nullable_text'
                    ],
                 ]
            ]
    ],
    'add_label'   => 'Add Condition to check your contact\'s properties',
]

This is an example condition_block_groups type field component, you can find this structure in every integration. The labels are a required property. The groups field contains the condition groups of a specific condition_block_groups type field component.

The preview of this condition block groups

screenshot 2022 09 01 at 10.52.37 am
screenshot 2022 09 01 at 10.50.34 am

Custom sender config

'mailer_settings' => [
    'type'        => 'custom_sender_config',
    'check_label' => 'Set Custom From Name and Email',
]

This is an example custom_sender_config type field component, you can find this structure in every integration. The check_label property is the title of the block

The preview of this example block

screenshot 2022 09 01 at 11.10.55 am

Radio buttons

'wait_type'        => [
    'type'    => 'radio_buttons',
    'label'   => 'Waiting Type',
    'options' => [
        [
            'id'    => 'unit_wait',
            'title' => 'Wait for a specific period'
        ],
        [
            'id'    => 'timestamp_wait',
            'title' => 'Wait until a specific date-time'
        ],
        [
            'id'    => 'to_day',
            'title' => 'To a day of the week'
        ]
    ]
],

This is an example radio_buttons type field component, you can find this structure in every integration. The options property is a list.

options possible sets:

keyDescription
idset selector id
titleset selector title

The preview of this example block.

screenshot 2022 09 02 at 12.08.55 pm

Checkboxes

'to_day'            => [
    'type'          => 'checkboxes',
    'label'         => 'Wait until next day(s) of the week',
    'wrapper_class' => 'fc_2col_inline pad-r-20',
    'options'       => [
        [
            'id'    => 'Mon',
            'title' => 'Mon'
        ]
    ],
],

This is an example checkboxes type field component, you can find this structure in every integration. The options property is a list containing days info of a week. This example block depends on a wait_type field. If the wait_type value is to_day, then this block will show.

options possible sets:

keyDescription
idset selector id
titleset selector title

The preview of this example block.

screenshot 2022 09 02 at 12.12.39 pm

Time selector

'to_day_time'        => [
    'label'          => 'Time of the day',
    'type'           => 'time_selector',
    'placeholder'    => 'Select Time',
    'wrapper_class'  => 'fc_2col_inline',
    'picker_options' => [
        'start' => '00:00',
        'step'  => '00:10',
        'end'   => '23:59'
    ]
]

This is an example time_selector type field component, you can find this structure in every integration. The picker_options property contains three properties named start, step & end. This example block depends on a wait_type field. If the wait_type value is to_day, then this block will show.

options possible sets:

keyDescription
idset selector id
titleset selector title

The preview of this example block.

screenshot 2022 09 02 at 12.16.33 pm

Latest comments (1)