Configure Field Rules (At Run-Time)

Overview

This article explains how to apply Field Rules at run-time. There are three key methods for applying these rules:

  • By Full Field Name: Configure specific properties for individual form fields by providing the full field name (e.g., 1own.FName for the first owner's first name).

  • By Partial Field Name: Apply field properties to all form fields that match a partial field name (e.g., "FName" to cover First Name fields for all roles).

  • By Role: Customize field properties based on the role of the user (e.g., "1own" or "2own"), allowing for differentiated form behavior and presentation based on roles.

Field Rule Properties

Parameter

Type

Description

Parameter

Type

Description

FieldName

String

The partial field name to be used. All fields containing this string will have the properties set up. E.g. "Name" will cover fields "FName", "MName", "LName", etc.

FieldVisibility

Integer

Sets the visibility of the field. Values:        

  • NotSet = -1       

  • NotSet = -1

  • None = 0       

  • Visible_No_Print = 1      

  • Hidden = 2       

  • Visible = 4

FieldReadOnly

Integer

Sets the read-only level of the field. Values: 

  • NotSet = -1

  • NoRestrictions = 0

  • Read_Only = 1

FieldRequired

Integer

Sets the required level of the field. Values:

  • NotSet = -1

  • NotRequired = 0

  • Required = 1

FieldMaskFlag

Boolean

If true, the field will be masked (password field)

FieldFormat

String

Sets the format to be applied to the value of the field

FieldCalcOverride

Boolean

If true, calculations are not enabled for the field. Usually used with calculated fields, like FullName or Addr123

HiddenField

Boolean

If true, the field will be a hidden input (input type = "hidden")

FieldBackgroundColor

String

Sets the background color of the field. E.g "#CCC", or "#AABBCC"

MaxCharLength

String

Sets the maximum character length that may be entered into a field. For example, if MaxCharLength = "5", then users may not type a value into a given field that is more than 5 characters long–the value will cut off after the 5th character. However, this field may still be prefilled with data that is longer than 5 characters (maximum length only takes effect when values are manually typed onto the form by users).


Configuring Field Rules by Full Field Name

You can configure field properties for specific fields by using the full field name in the FormFields object.

Example:

{ "QuikFormID": "12", "HostFormOnQuik": true, "FieldAttributesManagerOff": false, "FieldAttributesManagerTest": false, "FormFields": [ { "FieldName": "1own.FName", "FieldValue": "John", "FieldBackgroundColor": "#FFFFFF", // White background "FieldReadOnly": 0, // Editable "FieldVisibility": 4, // Visible "FieldRequired": 1, // Required "FieldMaskFlag": false, // Not masked "FieldCalcOverride": false, // Calculations enabled "HiddenField": false, // Not hidden "MaxCharLength": 50 // Max length of 50 characters }, { "FieldName": "1own.SSN", "FieldValue": "123451234", "FieldReadOnly": 1, // Read-only "FieldVisibility": 4, // Visible "FieldRequired": 1, // Required "FieldMaskFlag": true, // Masked "MaxCharLength": 11 // Max length of 11 characters } ] }

This example shows how to configure field properties such as background color, read-only status, visibility, and maximum character length for specific fields in a form, using the full field name.


Configuring Field Rules by Partial Field Name

The BulkFieldPropertiesByFieldName object allows you to apply field rules to all fields matching a partial field name. This is useful for setting common attributes for fields like “SSN”, “FName”, and “LName”.

Example:

{ "QuikFormID": "12", "HostFormOnQuik": true, "FieldAttributesManagerOff": false, "FieldAttributesManagerTest": false, "BulkFieldPropertiesByFieldName": [ { "FieldName": "SSN", "FieldVisibility": 4, // Visible "FieldReadOnly": 1, // Read-Only "FieldRequired": 1, // Required "FieldMaskFlag": true, // Masked (e.g., for passwords) "FieldFormat": "###-##-####", // SSN format "FieldCalcOverride": false, // Calculations enabled "HiddenField": false, // Not hidden "FieldBackgroundColor": "#FFFF00", // Yellow background "MaxCharLength": 11 // Max length of 11 characters }, { "FieldName": "FName", "FieldVisibility": 4, // Visible "FieldReadOnly": 0, // Editable "FieldRequired": 1, // Required "FieldMaskFlag": false, // Not masked "FieldBackgroundColor": "#CCC" // Light gray background }, { "FieldName": "LName", "FieldVisibility": 4, // Visible "FieldReadOnly": 0, // Editable "FieldRequired": 1, // Required "FieldMaskFlag": false, // Not masked "FieldBackgroundColor": "#CCC" // Light gray background } ] }

In this example:

  • The "SSN" field is visible, read-only, required, and masked with a specific format, a yellow background, and a max length of 11.

  • The "FName" and “LName” fields are visible, editable, and required with a light gray background.


Configuring Field Rules by Role

The BulkFieldPropertiesByRole object allows you to apply field rules to fields based on their role in the form. This is useful when different roles (e.g., Owner 1, Owner 2) have different field configurations.

Example:

{ "QuikFormID": "12", "HostFormOnQuik": true, "FieldAttributesManagerOff": false, "FieldAttributesManagerTest": false, "BulkFieldPropertiesByRole": [ { "RoleName": "1own", "FieldName": "FName", "FieldVisibility": 4, // Visible "FieldReadOnly": 0, // Editable "FieldRequired": 1, // Required "FieldBackgroundColor": "#FFFFC5" // Light yellow background }, { "RoleName": "2own", "FieldName": "FName", "FieldVisibility": 2, // Hidden "FieldReadOnly": 1, // Read-Only "FieldRequired": 0, // Not required "FieldBackgroundColor": "#ADD8E6" // Light blue background } ] }

In this example:

  • Owner 1 first name (FName) field is visible, editable, required, and has a light yellow background.

  • Owner 2 first name (FName) field is hidden, read-only, not required, and has a light blue background.

For help regarding Quik! Forms and the Quik! API
Email: support@quikforms.com | Phone: (877) 456-QUIK