Wiki source code of Fields
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | (% class="box" %) | ||
| 2 | ((( | ||
| 3 | **Contents:** | ||
| 4 | |||
| 5 | {{toc start="3"/}} | ||
| 6 | ))) | ||
| 7 | |||
| 8 | In Loymax Smart Communications, you have the ability to manage custom fields for the following objects: | ||
| 9 | |||
| 10 | * **Customers**; | ||
| 11 | * **Receipts**; | ||
| 12 | * **Receipt lines**; | ||
| 13 | * **Orders**; | ||
| 14 | * **Order lines**; | ||
| 15 | * **Products**; | ||
| 16 | * **Categories**; | ||
| 17 | * **Loyalty cards**. | ||
| 18 | |||
| 19 | |(% style="border-color:#ffffff; text-align:center" %){{lightbox image="Fields_Set.png" width="900"/}} | ||
| 20 | |||
| 21 | === Data marts === | ||
| 22 | |||
| 23 | |(% style="border-color:white; width:912px" %)((( | ||
| 24 | Data marts are custom data structures (objects) with an arbitrary set of fields. A data mart can be populated with Partner data or output data from the [[Loymax AI>>doc:Main.Loymax_AI.WebHome]] module. Data from data marts can be used in [[campaigns>>doc:Main.Smart_Communications.SMC_Use.Campaigns.WebHome]] and in the [[Segment Builder>>doc:Main.Smart_Communications.SMC_Use.Customers.User_segments.Segment_builder.WebHome]]. | ||
| 25 | |||
| 26 | A data mart can contain a single data set (one-to-one) or multiple sets (one-to-many, multimart). | ||
| 27 | |||
| 28 | To create a data mart, click the plus icon ([[image:plus.png]]) highlighted in the image above. A modal window will open where you need to specify: | ||
| 29 | |||
| 30 | * **Data mart name**; | ||
| 31 | * **Data mart code**; | ||
| 32 | * **Data mart type:** | ||
| 33 | ** One-to-one — for a unique customer, there will be only one associated record in the data mart; | ||
| 34 | ** One-to-many — for a unique customer, there can be any number of associated records in the data mart. | ||
| 35 | )))|(% style="border-color:white; width:526px" %){{lightbox image="Data_mart_create.png" width="400"/}} | ||
| 36 | |||
| 37 | === Field List === | ||
| 38 | |||
| 39 | In the **Fields** section, you can view a list of all fields used in the **System**. | ||
| 40 | |||
| 41 | Some objects are divided into **groups**. For example, fields of the **Customers** object are grouped as follows: | ||
| 42 | |||
| 43 | * Customer; | ||
| 44 | * Contacts; | ||
| 45 | * Bonuses; | ||
| 46 | * Scoring. | ||
| 47 | |||
| 48 | For each field, the following information is displayed: | ||
| 49 | |||
| 50 | * **Name** — the name of the field visible to users; | ||
| 51 | * **Field Code** (system name) — the system identifier used when accessing the field via REST API; | ||
| 52 | * **Field Type** (string, date, integer, etc.); | ||
| 53 | * **Field Scope** — either **system** or **custom**: | ||
| 54 | ** **System** fields are pre-defined in the System; | ||
| 55 | ** **Custom** fields are created by users. | ||
| 56 | |||
| 57 | (% class="box infomessage" %) | ||
| 58 | ((( | ||
| 59 | **Note: **custom fields can be edited and deleted. System fields have limited editing capabilities and cannot be deleted. | ||
| 60 | ))) | ||
| 61 | |||
| 62 | === Field Order === | ||
| 63 | |||
| 64 | * You can change the order of fields and object groups by dragging them. | ||
| 65 | * Fields are displayed in the same order in the [[Segment builder>>doc:Main.Smart_Communications.SMC_Use.Customers.User_segments.Segment_builder.WebHome]] as they appear in the fields list. | ||
| 66 | * The field order in the [[Customer profile>>doc:Main.Smart_Communications.SMC_Use.Customers.All_customers.WebHome||anchor="Profile"]] is configured through profile view settings. For more details, see the article [[View management>>doc:Main.Smart_Communications.SMC_Use.Settings_SC.Data_field.Views_management.WebHome]]. | ||
| 67 | |||
| 68 | === Filtering by Field Names === | ||
| 69 | |||
| 70 | If needed, you can filter the list of fields using the **Search** bar by field name. For example, you can find all fields containing the word "name". | ||
| 71 | |||
| 72 | |(% style="border-color:#ffffff; text-align:center" %){{lightbox image="Search_cust_mane.png" width="900"/}} | ||
| 73 | |||
| 74 | === Object Visibility in Customer Profile === | ||
| 75 | |||
| 76 | The **Receipts** and **Receipt Lines** objects can be hidden in the customer profile. To do this, check the **Hide receipts**/**Hide receipt lines** box on the corresponding tabs. | ||
| 77 | |||
| 78 | |(% style="border-color:#ffffff; text-align:center" %){{lightbox image="Receipt_hide.png" width="900"/}} | ||
| 79 | |||
| 80 | (% class="table-bordered" %) | ||
| 81 | (% class="info" %)|(% style="width:626px" %)An example of the **Receipts** tab in the **Customer profile,** when receipts are visible, is shown below.|(% style="width:812px" %)When **Receipt lines** are enabled, they are displayed when clicking the identifier value in the **Identifier** column on the **Receipts** tab in the **Customer profile**. A window titled **Content** opens. | ||
| 82 | |(% style="width:626px" %){{lightbox image="Cust_prof_R.png"/}}|(% style="width:812px" %){{lightbox image="Customer_contents.png" width="600"/}} | ||
| 83 | (% class="info" %)|(% style="width:626px" %)If receipts are hidden, the **Receipts** tab is not displayed in the **Customer profile**.|(% style="width:812px" %)Example of the **Content** window when **receipt lines** are hidden. | ||
| 84 | |(% style="width:626px" %){{lightbox image="Cust_prof_noR.png"/}}|(% style="width:812px" %){{lightbox image="Customer_noContents.png"/}} | ||
| 85 | |||
| 86 | === Adding Fields === | ||
| 87 | |||
| 88 | **~1. Adding a Field Group** | ||
| 89 | |||
| 90 | To add a new field group, click the **Add group** button in the top-right corner. In the opened **Group Property** window, specify the **Group Name**. | ||
| 91 | |||
| 92 | |(% style="border-color:#ffffff; text-align:center" %){{lightbox image="Add_Field_group.png" width="500"/}} | ||
| 93 | |||
| 94 | **{{id name="Add_field"/}}2. Adding a Field** | ||
| 95 | |||
| 96 | To create a new field, click the **Add field** button. A window will open where you need to fill in the **field properties**. | ||
| 97 | |||
| 98 | |(% style="border-color:white; width:870px" %)((( | ||
| 99 | Fields may have different properties depending on their type. Complete the **common field properties** and the properties specific to the selected **field type**. | ||
| 100 | |||
| 101 | ==== **Common Properties** ==== | ||
| 102 | |||
| 103 | * **Group name** — the group to which the field belongs; | ||
| 104 | * **Field name** — the name of the field visible to users; | ||
| 105 | * **Field code** — the system name of the field used when accessing the field via [[REST API>>doc:Main.Smart_Communications.SMC_integration.Data_exchange.SmC_API.WebHome]]; | ||
| 106 | * **Description**; | ||
| 107 | * **Data type:** | ||
| 108 | ** integer, | ||
| 109 | ** double, | ||
| 110 | ** string, | ||
| 111 | ** date, | ||
| 112 | ** boolean. | ||
| 113 | |||
| 114 | * **Operators**. Not all operators are applicable for every field. For example, for the **Gender** field, only the following operators will be available: **equal**, **not equal**, **is null**, **is not null**. These are the only operators that will appear in the [[Segment builder>>doc:Main.Smart_Communications.SMC_Use.Customers.User_segments.Segment_builder.WebHome]] when creating conditions for this field: | ||
| 115 | |||
| 116 | {{lightbox image="Operator_Gender.png" width="500"/}} | ||
| 117 | |||
| 118 | * **Show field**. A visible field will be displayed: | ||
| 119 | ** in the Segment builder; | ||
| 120 | ** in customer lists and the customer profile. | ||
| 121 | |||
| 122 | Invisible fields will appear in light gray in the field list. | ||
| 123 | |||
| 124 | {{lightbox image="Hidden_field.png" width="500"/}} | ||
| 125 | |||
| 126 | * **Type**: field or metric. | ||
| 127 | )))|(% style="border-color:white; width:568px" %){{lightbox image="Field_property.png"/}} | ||
| 128 | |||
| 129 | ==== **Field Properties Depending on Data Type** ==== | ||
| 130 | |||
| 131 | * [[Properties of a field with type "integer">>doc:||anchor="01"]]; | ||
| 132 | * [[Properties of a field with type "decimal">>doc:||anchor="02"]]; | ||
| 133 | * [[Properties of a field with type "string">>doc:||anchor="03"]]; | ||
| 134 | * [[Properties of a field with type "date">>doc:||anchor="04"]]; | ||
| 135 | * [[Properties of boolean fields>>doc:||anchor="05"]]; | ||
| 136 | |||
| 137 | ===== **{{id name="01"/}}Properties of Integer Fields** ===== | ||
| 138 | |||
| 139 | In addition to common properties, integer fields have the **Control** property with the following options: | ||
| 140 | |||
| 141 | * input, | ||
| 142 | * value. | ||
| 143 | |||
| 144 | Each control type has its own set of additional properties. | ||
| 145 | |||
| 146 | (% class="table-bordered" %) | ||
| 147 | (% class="info" %)|(% style="width:440px" %)**Input**|(% style="width:412px" %)**Value** | ||
| 148 | |(% style="width:440px" %)((( | ||
| 149 | For input fields, the following additional properties are available: | ||
| 150 | |||
| 151 | * **Min value**; | ||
| 152 | * **Max value**; | ||
| 153 | * **Increment** — the step by which the field value can be increased; | ||
| 154 | * **Default value** — this value will automatically appear in the [[Segment builder>>doc:Main.Smart_Communications.SMC_Use.Customers.User_segments.Segment_builder.WebHome]]. | ||
| 155 | |||
| 156 | {{lightbox image="Int_Control_input.png" width="400"/}} | ||
| 157 | |||
| 158 | |||
| 159 | )))|(% style="width:412px" %)((( | ||
| 160 | The following additional properties are available: | ||
| 161 | |||
| 162 | * **Display**: | ||
| 163 | ** **select**; | ||
| 164 | ** **autocomplete** — suggests matching values as you type; | ||
| 165 | ** **radio button**. | ||
| 166 | * **Variants**: | ||
| 167 | ** **options** — allows specifying possible field values directly in the field settings; | ||
| 168 | ** **data from DB** — allows selecting a value from the database. For example, the [[Segment builder>>doc:Main.Smart_Communications.SMC_Use.Customers.User_segments.Segment_builder.WebHome]] will generate a list of all unique values stored in this field in the database and display them. | ||
| 169 | |||
| 170 | The **Add option** and **Remove option** functions are also available. | ||
| 171 | |||
| 172 | {{lightbox image="Int_Control_value.png" width="400"/}} | ||
| 173 | ))) | ||
| 174 | |||
| 175 | ===== **{{id name="02"/}}Properties of Double Fields** ===== | ||
| 176 | |||
| 177 | |(% style="border-color:white; width:742px" %)((( | ||
| 178 | Double fields support the following additional properties: | ||
| 179 | |||
| 180 | * **Min value**; | ||
| 181 | * **Max value**; | ||
| 182 | * **Increment** — the step by which the field value can be increased. For example, if the minimum is 1, maximum is 2, and increment is 0.5, the field can take the values: 1, 1.5, 2; | ||
| 183 | * **Default value** — this value will automatically appear when creating a request in the [[Segment builder>>doc:Main.Smart_Communications.SMC_Use.Customers.User_segments.Segment_builder.WebHome]]. | ||
| 184 | )))|(% style="border-color:white; width:696px" %){{lightbox image="Double.png" width="400"/}} | ||
| 185 | |||
| 186 | ===== **{{id name="03"/}}Properties of String Fields** ===== | ||
| 187 | |||
| 188 | For fields with the type **String**, the **Control Type** property is available with the following options: | ||
| 189 | |||
| 190 | * **Input**; | ||
| 191 | * **Value**; | ||
| 192 | * **List**. | ||
| 193 | |||
| 194 | Each **control type** has its own set of additional properties. | ||
| 195 | |||
| 196 | (% class="table-bordered" %) | ||
| 197 | (% class="info" %)|(% style="width:440px" %)**Input**|(% style="width:412px" %)**Value**|(% style="width:412px" %)**List** | ||
| 198 | |(% style="width:440px" %)((( | ||
| 199 | The following additional properties are available for input fields: | ||
| 200 | |||
| 201 | * **Max length** — limits the length of the field value; | ||
| 202 | * **Default value**. | ||
| 203 | |||
| 204 | |||
| 205 | )))|(% style="width:412px" %)((( | ||
| 206 | The following additional properties are available: | ||
| 207 | |||
| 208 | * **Display**: | ||
| 209 | ** **select**; | ||
| 210 | ** **autocomplete** — suggests matching values as you type; | ||
| 211 | ** **radio button**. | ||
| 212 | * **Variants**: | ||
| 213 | ** **options** — allows specifying possible field values directly in the field settings; | ||
| 214 | ** **data from DB** — allows selecting a value from the database. For example, the [[Segment builder>>doc:Main.Smart_Communications.SMC_Use.Customers.User_segments.Segment_builder.WebHome]] will generate a list of all unique values stored in this field in the database and display them. | ||
| 215 | |||
| 216 | The **Add Option** and **Remover option** functions are also available. | ||
| 217 | |||
| 218 | |||
| 219 | )))|(% style="width:412px" %)((( | ||
| 220 | The following additional properties are available: | ||
| 221 | |||
| 222 | * **Display**: | ||
| 223 | ** **select**; | ||
| 224 | ** **autocomplete** — suggests matching values as you type; | ||
| 225 | ** **radio button**. | ||
| 226 | * **Data**: | ||
| 227 | ** **new** — if no suitable dictionary exists in the System, create a new one by specifying its **Name** and **Code**; | ||
| 228 | ** **existing** — if the required dictionary already exists in the System, select it by entering its name in the **Data name** field. | ||
| 229 | * **Data name**; | ||
| 230 | * **Data code** is used when accessing the dictionary via API. | ||
| 231 | |||
| 232 | Dictionaries can be managed and edited in the **Settings > Dictionaries** section. | ||
| 233 | |||
| 234 | You can read more about reference books in the article [[Dictionaries>>doc:Main.Smart_Communications.SMC_Use.Settings_SC.Directories.WebHome]]. | ||
| 235 | ))) | ||
| 236 | |(% style="width:440px" %){{lightbox image="String_Ctrl_input.png" width="400"/}}|(% style="width:412px" %){{lightbox image="String_Ctrl_value.png"/}}|(% style="width:412px" %){{lightbox image="String_Ctrl_list.png" width="400"/}} | ||
| 237 | |||
| 238 | ===== **{{id name="04"/}}Properties of Date Fields** ===== | ||
| 239 | |||
| 240 | |(% style="border-color:white; width:898px" %)((( | ||
| 241 | For date fields, there is an additional property called **Add field with distance to date**, which enables calculating how much time has passed since a specific date. | ||
| 242 | |||
| 243 | * The field will appear in the [[Customer profile>>doc:Main.Smart_Communications.SMC_Use.Customers.All_customers.WebHome||anchor="Profile"]]; | ||
| 244 | * The field can be used when building queries in the [[Segment builder>>doc:Main.Smart_Communications.SMC_Use.Customers.User_segments.Segment_builder.WebHome]]. | ||
| 245 | |||
| 246 | For example, let's assume there is a field **Wedding Date**. You can add an additional field — **Days since wedding date**. This new field can then be used in the Segment Builder: | ||
| 247 | |||
| 248 | {{lightbox image="Segment_B_Wedding.png"/}} | ||
| 249 | )))|(% style="border-color:white; text-align:center; vertical-align:middle; width:540px" %){{lightbox image="Date1.png"/}} | ||
| 250 | |||
| 251 | ===== {{id name="05"/}}Properties of Boolean Fields ===== | ||
| 252 | |||
| 253 | |(% style="border-color:white; width:559px" %)((( | ||
| 254 | Fields of the boolean type do not have any additional properties. | ||
| 255 | |||
| 256 | Only five operators are available for this field type: | ||
| 257 | |||
| 258 | * equal, | ||
| 259 | * is null, | ||
| 260 | * is not null, | ||
| 261 | * in, | ||
| 262 | * not in. | ||
| 263 | )))|(% style="border-color:white; width:879px" %){{lightbox image="Boolean.png"/}} | ||
| 264 | |||
| 265 | === Editing Fields === | ||
| 266 | |||
| 267 | **~1. Editing a Field Group** | ||
| 268 | |||
| 269 | To edit a field group, click the **Edit** icon [[image:Edit_button.png]] to the right of the group name. Only the **Group name** can be edited. | ||
| 270 | |||
| 271 | |(% style="border-color:#ffffff; text-align:center" %){{lightbox image="Edit_group.png" width="900"/}} | ||
| 272 | |||
| 273 | (% class="wikigeneratedid" id="H42043543443043A44243844043E43243043D43843543F43E43B44F" %) | ||
| 274 | **2. Editing a Field** | ||
| 275 | |||
| 276 | To edit a field, click the **Edit** icon to the right of the field name. For custom fields, **all** properties described in the section [[Adding a Field>>doc:||anchor="Add_field"]] are editable. For system fields, only a subset of properties can be edited: | ||
| 277 | |||
| 278 | |(% style="border-color:#ffffff; text-align:center" %){{lightbox image="Edit_field.png" height="500"/}} | ||
| 279 | |||
| 280 | === Deleting Fields === | ||
| 281 | |||
| 282 | **~1. Deleting a Field Group** | ||
| 283 | |||
| 284 | To delete a field group, click the **Delete** icon to the right of the group name. | ||
| 285 | |||
| 286 | |(% style="border-color:#ffffff; text-align:center" %){{lightbox image="Delete_group.png" width="900"/}} | ||
| 287 | |||
| 288 | (% class="box warningmessage" %) | ||
| 289 | ((( | ||
| 290 | **Note:** You can delete a group only if it does not contain fields. | ||
| 291 | ))) | ||
| 292 | |||
| 293 | **2. Deleting a Field** | ||
| 294 | |||
| 295 | To delete a field, click the **Delete** icon to the right of the field name. | ||
| 296 | |||
| 297 | (% class="box warningmessage" %) | ||
| 298 | ((( | ||
| 299 | **Note: **You can delete only **custom** fields. **System** fields cannot be deleted. | ||
| 300 | ))) |