Defining selection values, mandatory fields and default values

Allowed selection values and mandatory fields

Remember our previous example. We had entered the item numbers manually. But you can already define values for fields in the profile in field attribute "Allowed values" (separated by semicolons), which you can then select from a list in the form . Note: If values are specified this way, you cannot manually enter a value in the form, but only select it from the list. Note: You can use a regular expression regex:xxx to check allowed values (but this does not create a selection list) .


images/download/attachments/189457388/Portal_Feld_Erlaubte_Werte_EN-version-2-modificationdate-1742961844991-api-v2.png


Let's also use this opportunity to make the order number a mandatory field by setting the source structure field attribute " Minimum" of field " order_number" to " 1" . We then do the same for field " item_number" . The attribute " Maximum" has no effect on fields.

In the form it will look like this.


images/download/attachments/189457388/datafox_11_EN-version-1-modificationdate-1736305146411-api-v2.png


If you insert an " items" row, you must enter an " item_number" , otherwise an error will occur. But there will be no error if you do not insert an " items" row at all. If you want an order without items to cause an error , you must also set the " Minimum" attribute of the " items" node to " 1" .

Default value

It is also possible to give a field a default value with field attribute "Default value".


images/download/attachments/189457388/default_value_1_EN-version-2-modificationdate-1742962053217-api-v2.png

In the form it will look like this.

images/download/attachments/189457388/datafox_12-version-1-modificationdate-1736305146407-api-v2.png

Example profile


To save you the work and for verification, here is the described profile to import. After importing the profile, do not forget to set it active. Also, you need to create your own Web Monitor user, if you haven't already, and select it (or the role it has) in phase 1.