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 (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/78250019/Portal_Feld_Erlaubte_Werte_EN-version-2-modificationdate-1644571145333-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/78250019/datafox_11_EN-version-1-modificationdate-1626064609989-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.


images/download/attachments/78250019/default_value_1_EN-version-2-modificationdate-1644571375472-api-v2.png

In the form it will look like this.

images/download/attachments/78250019/datafox_12-version-1-modificationdate-1626064609998-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.