{"id":18363,"date":"2024-04-01T14:49:12","date_gmt":"2024-04-01T14:49:12","guid":{"rendered":"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/?post_type=article&#038;p=18363"},"modified":"2025-12-05T17:17:18","modified_gmt":"2025-12-05T11:47:18","slug":"rules-in-form-2-0-fields","status":"publish","type":"article","link":"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/article\/rules-in-form-2-0-fields\/","title":{"rendered":"Rules in Form 2.0 Fields"},"content":{"rendered":"<p>In this article, we will help you understand how to define a rule on a field in a form using the Form 2.0 Configuration.<\/p>\n<table style=\"line-height: 10px; height: 77px; width: 99.2704%; border-collapse: collapse; background-color: #f7f7f7;\">\n<tbody>\n<tr style=\"height: 108px;\">\n<td style=\"width: 100%; height: 77px;\">\n<p style=\"text-align: left;\"><strong>Skip Ahead to:<\/strong><\/p>\n<p class=\"p1\" style=\"text-align: left;\"><a href=\"#Introduction\">Introduction<\/a><\/p>\n<p class=\"p1\" style=\"text-align: left;\"><a href=\"#Font\">Font Color Decorator Rule<\/a><\/p>\n<p class=\"p1\" style=\"text-align: left;\"><a href=\"#Icon\">Icon Decorator Rule<\/a><\/p>\n<p class=\"p1\" style=\"text-align: left;\"><a href=\"#Validation\">Validation Rule<\/a><a id=\"Introduction\"><\/a><a href=\"#Validation\"><\/a><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Introduction<\/h3>\n<p>Rules let you set conditions on fields so their appearance changes based on the value entered.<\/p>\n<p><strong>For example:<\/strong> In a Marks field, if a student gets <strong data-start=\"161\" data-end=\"175\">36 or more<\/strong>, the field can appear in <strong data-start=\"201\" data-end=\"210\">green<\/strong>, and if the marks are <strong data-start=\"233\" data-end=\"245\">below 36<\/strong>, it can appear in <strong data-start=\"264\" data-end=\"271\">red<\/strong>.<br data-start=\"272\" data-end=\"275\" \/>Similarly, if a user enters a title in the Name field, it can be highlighted in <strong data-start=\"355\" data-end=\"362\">red<\/strong> to indicate it\u2019s not allowed.<\/p>\n<ul>\n<li>This tab is available for <strong data-start=\"424\" data-end=\"440\">Field blocks<\/strong> and <strong data-start=\"445\" data-end=\"464\">List Item block<\/strong> fields.<\/li>\n<\/ul>\n<p>There are three types of Rules &#8211;<\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><strong>Font Color Decorator Rule<\/strong><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><strong>Icon Decorator Rule<\/strong><a id=\"Font\"><\/a><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><strong>Validation Rule<\/strong><\/li>\n<\/ol>\n<h3>Font Color Decorator Rule<\/h3>\n<p data-start=\"0\" data-end=\"209\">Font color decorators let you set conditions on a field so that when the condition is met, the font color changes accordingly. You can define multiple rules on the same field.<\/p>\n<p data-start=\"211\" data-end=\"317\">For example, if you create three rules \u2014 Rule A, Rule B, and Rule C \u2014 with colors Green, Blue, and Grey:<\/p>\n<ul data-start=\"318\" data-end=\"385\">\n<li data-start=\"318\" data-end=\"385\">\n<p data-start=\"320\" data-end=\"385\">If the condition for Rule A is met, the font becomes <strong data-start=\"373\" data-end=\"382\">Green<\/strong>.<\/p>\n<\/li>\n<\/ul>\n<p data-start=\"387\" data-end=\"506\" data-is-last-node=\"\" data-is-only-node=\"\"><strong>Note:<\/strong> Only one rule can be applied at a time, so the field will display only one font color based on the first matching rule.<\/p>\n<p>To define a rule based on font color, perform the following steps &#8211;<\/p>\n<ol>\n<li>Click the <b>Rule<\/b>\u00a0tab.<\/li>\n<li>Click the <b>Add Rule<\/b> button next to <b>Font Color<\/b>.<br \/>\n<a href=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Font-Color.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-18364 size-full\" src=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Font-Color.png\" alt=\"Font Color\" width=\"2608\" height=\"1138\" srcset=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Font-Color.png 2608w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Font-Color-300x131.png 300w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Font-Color-1024x447.png 1024w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Font-Color-768x335.png 768w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Font-Color-1536x670.png 1536w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Font-Color-2048x894.png 2048w\" sizes=\"(max-width: 2608px) 100vw, 2608px\" \/><\/a><\/li>\n<li>Select the name of the field from the <b>Field name<\/b> list. It displays all the fields available in the form. You can define a rule on the value of any field available in the form.<\/li>\n<li>Select the condition from the <b>Data Condition<\/b> drop-down list such as if the specified value is equal to or contains the given characters etc. These conditions change as per the field selected in the previous field.<br \/>\n<table class=\" alignleft\" style=\"height: 131px; width: 99.2677%; border-collapse: collapse; border-style: solid; border-color: #000000;\">\n<tbody>\n<tr style=\"height: 31px;\" data-start=\"715\" data-end=\"795\">\n<th style=\"width: 25.5741%; height: 31px;\" data-start=\"715\" data-end=\"739\" data-col-size=\"sm\">Field Type<\/th>\n<td style=\"width: 73.7767%; height: 31px;\"><strong>Conditions<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 20px;\">\n<td style=\"width: 25.5741%; height: 20px;\"><strong>Number Field:<\/strong><\/td>\n<td style=\"width: 73.7767%; height: 20px;\">is equal to, is not equal to, greater than, greater than or equal to, less than, less than or equal to<\/td>\n<\/tr>\n<tr style=\"height: 20px;\">\n<td style=\"width: 25.5741%; height: 20px;\"><strong>Text Field:<\/strong><\/td>\n<td style=\"width: 73.7767%; height: 20px;\">is equal to, is not equal to, contains, does not contain<\/td>\n<\/tr>\n<tr style=\"height: 20px;\">\n<td style=\"width: 25.5741%; height: 20px;\"><strong>Multi-Line or RTF:<\/strong><\/td>\n<td style=\"width: 73.7767%; height: 20px;\">contains, does not contain<\/td>\n<\/tr>\n<tr style=\"height: 20px;\">\n<td style=\"width: 25.5741%; height: 20px;\"><strong>Master List Field:<\/strong><\/td>\n<td style=\"width: 73.7767%; height: 20px;\">\u00a0is, is not, is any of, is not any of, contains, does not contain<\/td>\n<\/tr>\n<tr style=\"height: 20px;\">\n<td style=\"width: 25.5741%; height: 20px;\"><strong>URL Field:<\/strong><\/td>\n<td style=\"width: 73.7767%; height: 20px;\">\u00a0is equal to, is not equal to<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>Enter the value in the <b>Value<\/b> field.<\/li>\n<li><a id=\"Icon\"><\/a>Specify the color name in the <b>Font color<\/b> field. If the given condition is met, then the font of the specified field will be set to this color.<\/li>\n<li>To specify more than one condition, click the <b>Add rule<\/b> icon.<\/li>\n<li>To add multiple conditions, click the <strong data-start=\"223\" data-end=\"235\">Add Rule<\/strong> icon and define the next rule.<\/li>\n<li>Click <strong data-start=\"277\" data-end=\"285\">Save<\/strong> to apply the rule.<\/li>\n<\/ol>\n<ul>\n<li>Font Color Decorator rules are available in <strong>single-line, multi-line, Numbers, <\/strong>and <strong>URL fields.<\/strong><\/li>\n<\/ul>\n<h3>Icon Decorator Rule<\/h3>\n<p>An Icon Decorator lets you display an icon next to a field value when its condition is met.<\/p>\n<p><strong>For example<\/strong>, if marks are below 50, a minus icon can appear, and if marks are above 50, a plus icon can be shown. You can set additional conditions such as showing an upward arrow when a number is greater than 200, a downward arrow when it is less than 100, and a straight-line icon when the value falls between 100 and 200.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18780\" src=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Formatting-copy.png\" alt=\"Icon Formatting\" width=\"2319\" height=\"1052\" srcset=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Formatting-copy.png 2319w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Formatting-copy-300x136.png 300w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Formatting-copy-1024x465.png 1024w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Formatting-copy-768x348.png 768w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Formatting-copy-1536x697.png 1536w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Formatting-copy-2048x929.png 2048w\" sizes=\"(max-width: 2319px) 100vw, 2319px\" \/><\/p>\n<p>To define a rule based on the icon decorator, perform the following steps &#8211;<\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\">Click the <b>Rule<\/b> tab <strong>&gt;<\/strong> <b>Icon Decorator\u00a0<\/b>next to <b>Add Rule.<\/b><br \/>\n<a href=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Icon-Decorator.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-18365 size-full\" src=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Icon-Decorator.png\" alt=\"Icon Decorator\" width=\"1921\" height=\"1057\" srcset=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Icon-Decorator.png 1921w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Icon-Decorator-300x165.png 300w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Icon-Decorator-1024x563.png 1024w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Icon-Decorator-768x423.png 768w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Icon-Decorator-1536x845.png 1536w\" sizes=\"(max-width: 1921px) 100vw, 1921px\" \/><\/a><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">Specify the condition such as less than, greater than, or between.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">Specify the value and the icon for the conditions.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">By default, three conditions are shown, however, you can add or remove them from the conditions.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">To add more conditions, click the <b>Add<\/b> icon.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">To remove a condition, click the <b>Delete<\/b> icon.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a id=\"Validation\"><\/a>To keep the condition same but reverse the order of the icons, turn on the <b>Reverse icon order<\/b> toggle.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">Click the <b>Save<\/b> button.<\/li>\n<\/ol>\n<table class=\" alignleft\" style=\"width: 89.4778%; border-collapse: collapse; border-style: solid; border-color: #000000;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><b>Note:<\/b>\u00a0Icon Decorator rules are available in the Numbers field only.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h3>Validation Rule<\/h3>\n<p>A validation rule lets you display a message when certain conditions are not met. For example, if a required field like <em data-start=\"142\" data-end=\"149\">Price<\/em> is left blank, you can set a rule that shows a message such as \u201cPlease enter the price of the item to proceed.\u201d<\/p>\n<p>Similarly, we can configure another validation where is the entered value is more than the set limit, then it shows a message.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18779\" src=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation-copy.png\" alt=\"Validation\" width=\"2596\" height=\"1131\" srcset=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation-copy.png 2596w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation-copy-300x131.png 300w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation-copy-1024x446.png 1024w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation-copy-768x335.png 768w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation-copy-1536x669.png 1536w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation-copy-2048x892.png 2048w\" sizes=\"(max-width: 2596px) 100vw, 2596px\" \/><\/p>\n<p>To add a rule based on validations, perform the following steps &#8211;<\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\">Click the <b>Rule<\/b> tab.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">Click the &gt;<b>Add Rule<\/b> button next to the <b>Validation rule<\/b>.<br \/>\n<a href=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-18366 size-full\" src=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation.png\" alt=\"Validation Rule\" width=\"2610\" height=\"1138\" srcset=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation.png 2610w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation-300x131.png 300w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation-1024x446.png 1024w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation-768x335.png 768w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation-1536x670.png 1536w, https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-content\/uploads\/2024\/04\/Validation-2048x893.png 2048w\" sizes=\"(max-width: 2610px) 100vw, 2610px\" \/><\/a><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">For the IF condition, select the name of the field from the <b>Field name<\/b> list. It displays all the fields available in the form. You can define a rule on the value of any field available in the form.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">Select the condition from the <b>Data Condition<\/b> drop-down list such as if the specified value is equal to or contains the given characters etc. These conditions change as per the field selected in the previous field.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">Enter the value in the <b>Value<\/b> field.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">For the <strong>THEN<\/strong> condition, enter the message that you want to show on the screen if the given condition is met.<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">Click the <b>Save<\/b> button.<\/li>\n<\/ol>\n<table class=\" alignleft\" style=\"width: 100.7%; border-collapse: collapse; border-style: solid; border-color: #000000;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><b>Note:<\/b> Validation rules are available in <strong>single-line, multi-line, numbers, master List, <\/strong>and <strong>URL<\/strong> fields.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<div class=\"helpful-block-content wth-theme-thumbs\" data-title=\"\" >\n<ul>\n<li><span class=\"wth-title\">Was this helpful?<\/span><\/li>\n<li><a data-post=\"18363\" data-post-url=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/article\/rules-in-form-2-0-fields\/\" data-post-title=\"Rules in Form 2.0 Fields\" data-response=\"1\" href=\"#\" class=\"wth-green-btn icon-thumbsup\">Yes<\/a>&nbsp; &nbsp;<a data-response=\"0\" data-post=\"18363\" data-post-url=\"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/article\/rules-in-form-2-0-fields\/\" data-post-title=\"Rules in Form 2.0 Fields\" href=\"#\" class=\"wth-red-btn icon-thumbsdown\">No<\/a><\/li>\n<\/ul>\n<\/div>","protected":false},"author":2,"featured_media":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","multi-rating":{"mr_rating_results":[]},"_links":{"self":[{"href":"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-json\/wp\/v2\/article\/18363"}],"collection":[{"href":"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-json\/wp\/v2\/types\/article"}],"author":[{"embeddable":true,"href":"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-json\/wp\/v2\/comments?post=18363"}],"version-history":[{"count":34,"href":"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-json\/wp\/v2\/article\/18363\/revisions"}],"predecessor-version":[{"id":22901,"href":"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-json\/wp\/v2\/article\/18363\/revisions\/22901"}],"wp:attachment":[{"href":"https:\/\/www.nimblework.com\/knowledge-base\/nimble\/wp-json\/wp\/v2\/media?parent=18363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}