Context: In a number of areas in Calpendo, it is possible to add in drop down menus such as choosing from a range of configuration options for a resource or choosing from funding sources for a project. The best way to setup a drop down menu with an option for selecting one item is to use Mapped Integers. For this Knowledge Base article, we will use the example of a resource which requires a drop down menu to choose it's current maintenance status. This sort of field would also be a prime contender to be set as editable only by admins. The steps below will be for creating a drop down menu, but editing will simply involve selecting a pre-existing mapped integer and clicking on 'edit' to change the values.
A mapped integer is a mapping between a number and a text display value. This provides an easy way for a user to set a number value for an item, but have it hidden behind a text value. This also means that the stored numeric value can be used when creating workflows or writing formulae which reference a value which has been set.
Suitable for: Administrators
Part 1 Step - creating the mapped int:
- Sign in as admin and go to Bakery in the admin menu
- Select Mapped Int from the tree view on the left
- Click create and supply a name such as 'Current Maintenance Status'
- Setting a null value label is useful for encouraging a user to select an option. In this context a null value label such as 'Please set a maintenance status' would work well
- Under values, click Add and start adding the text display labels and their equivalent numbers
- If the numbers or text are the same it will produce a red border highlighting these which you will need to fix
Part 2 Step - adding the mapped int to a biskit:
- Go back to the Biskit Def section of the Bakery
- Select a Biskit to which you wish to add a drop down menu
- Edit the Biskit
- Add a new property and set its type to Int
- Under Integer Type (further down the property definition list) select Mapped Int
- In the Mapped Int field which appears select the mapped int you created in part 1
- Save and Update DB Schema and then Reload DB Configuration and then refresh the Browser