Adding a Custom Field

Modified on Wed, 24 Apr 2024 at 04:00 PM

To add a custom field into Projectal, follow these steps:


  1. Go to the Management screen by clicking Management on the left sidebar.
  2. Click the Custom Fields button to display the Custom Fields screen.
  3. Select the entity from the Entity dropdown list that you wish to add a custom field to.
  4. Click the Add button on the Custom Fields screen toolbar.
  5. This will display the New Custom Field screen.




Field Name

Enter the name of the custom field.  The field name is used when you want to access data for this custom field using data views, the Projectal RESTful API and the Projectal Python library.


Tip: The field name must contain only letters, underscore or numbers and start with a lowercase letter.


Example: You wish to add an "Employment Code" custom field for staff in Projectal so you track the employment code coming from your HR system.  You would typically call the field name "employmentCode".  And, you would refer to this custom field as STAFF.employmentCode in your data views and connector applications that use the Projectal Restful API and Python library.


Tip: The field name must be unique and cannot have been used before for the selected entity.  This constraint also applies to custom fields that have been deleted.  Once deleted, the field name is considered to have been used and cannot be used again for the selected entity.


Display Name

Enter the display name of the custom field.  The display name is what users of Projectal will see (instead of the field name).   Users of Projectal will see the display names of custom fields on the Edit screens in Projectal.


Example: You have added the "employmentCode" custom field to the STAFF entity.  You give this custom field a display name of "Employment Code" and that is what is displayed in the Edit Staff screen.


Type

Select the type of custom field that you wish to create.  The available types are:

  • Boolean
  • String
  • Integer
  • Long Integer
  • Float
  • Double
  • Byte
  • Date
  • List of Strings
  • List of Integers
  • List of Long Integers
  • List of Floats
  • List of Doubles
  • List of Bytes


Once you have chosen the type, then the default value, min value, max value and regular expression restrictions will allow you to further define the custom field.



Tip: Once you have chosen the type for the custom field and saved the custom field, then the custom field's type cannot be changed.


Default Value

Enter the initial value for the custom field.  This will be used and displayed when users create new entities.  This is an optional attribute.


Example: You have added "employmentCode" string custom field to the STAFF entity.  You have set the display name to be "Employment Code" and the default value to be "EC-000".  When a user creates a new staff, the New Staff screen will display "Employment Code" and set "EC-000" as the initial value.


Tip: If you set a custom field to be Mandatory, then you also must set the default value as well.


Min Value

Enter the minimum value for the custom field.  This is an optional attribute.  If left empty, then the default minimum values will be used by Projectal for each specific custom field type.


Default minimum values used by Projectal:


Custom Field Type:Default Minimum Value:
BooleanNot Applicable
String0 (characters long)
Integer-2147483648
Long Integer-9223372036854775000
Float-3.4028235E38
Double-1.7976931348623157E308
Byte-128
Date1970-01-01
List of StringsNot Applicable
List of IntegersNot Applicable
List of Long IntegersNot Applicable
List of FloatsNot Applicable
List of DoublesNot Applicable
List of BytesNot Applicable


Max Value

Enter the maximum value for the custom field.  This is an optional attribute.  If left empty, then the default maximum values will be used by Projectal for each specific custom field type.


Default maximum values used by Projectal:


Custom Field Type:Default Maximum Value:
BooleanNot Applicable
String10,000 (characters long)
Integer2147483647
Long Integer9223372036854775000
Float3.4028235E38
Double1.7976931348623157E308
Byte127
Date3000-01-01
List of StringsNot Applicable
List of IntegersNot Applicable
List of Long IntegersNot Applicable
List of FloatsNot Applicable
List of DoublesNot Applicable
List of BytesNot Applicable


Restrict Values Using Regular Expression

Enter any additional formatting restrictions that values for the custom field must adhere to.  This is an optional attribute.


Tip: Regular expressions must follow the Java regular expression syntax.  See https://www.freeformatter.com/java-regex-tester.html for the Java syntax and examples.


Example: You have added "employmentCode" string custom field to the STAFF entity.  You have set the display name to be "Employment Code".  You want to make sure the format of the values entered by users are always "EC-" followed by 3 digits.  So you set the regular expression to be "EC-\d{3}".


When you set the type for the custom field to be a list (of strings, integers, floats, etc.), then the regular expression must specify the list of possible values in the list.


Example: If a custom field was a list of strings, then the regular expression would be defined like "string 1|string 2|string 3|string 4".



Example: If a custom field was a list of integers or long integers, then the regular expression would be defined like "10|20|30|40".



Example: If a custom field was a list of floats or doubles, then the regular expression would be define like "10.458|20.53|30.85|40.0365".


Mandatory

Click the Mandatory checkbox if you wish to force users to enter a value for this custom field when creating new entities or editing entities.  This is an optional attribute.


Tip: If you set a custom field to be Mandatory, then you must also set the default value as well.


Description

Enter a helpful description for the custom field.  This is displayed as a tooltip when hovering over the (?) icon next to the display name of the custom field on the Edit entity screens.  This is an optional attribute.


Example: You have added "employmentCode" string custom field to the STAFF entity.  You have set the display name to be "Employment Code".  You have added a description of "Employment code must begin with 'EC-' followed by 3 digits".  This is displayed as a tooltip on the Edit Staff screen to help users understand the requirements for entering the custom field.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article