Introduction
Protrak provides a set of standard attributes for all Types and allows administrators to define custom attributes, which can be associated with both Types and Relation Types.
Standard Attributes
The following standard attributes are available:
- Name
- Description
- TrackingId (when Tracking Required is enabled on the Type)
- TrackingInfo (when Tracking Required is enabled on the Type)
- Geolocation (when Geolocation Required is enabled on the Type)
- State (the lifecycle state)
- Creator (the user who created the instance)
- Modifier (the user who last modified the instance)
- Created (timestamp of instance creation)
- Modified (timestamp of last modification)
- VersionNumber (when versioning is enabled for the instance)
- QRCode
Working with Different Attribute Types
Protrak supports various data types for custom attributes. This guide explains how to work with attribute values in your code.
The Prorigo.Protrak.API.Contracts.Attribute class is used to represent attribute values in the Protrak API.
Attribute Contract
| Property | Data Type | Description |
|---|---|---|
Name | string | The attribute name defined in the schema. Unique for each attribute. May differ from the display name. |
Type | Prorigo.Protrak.API.Contracts.Enum.AttributeType | Enum: Text, Numeric, Date, Currency, Picklist, DateTime, RichText, Expression, Boolean, Attachment, User, Reference, Lifecycle |
CanUpdate | bool | Indicates if the attribute value can be updated for the given instance, based on permissions and lifecycle state. |
TextValue | string | Value for Text attributes. |
DateValue | DateTime? | Value for Date attributes. |
NumericValue | double? | Value for Numeric and Currency attributes. |
BooleanValue | bool? | Value for Boolean attributes. |
ArrayValue | string[] | Value for Picklist attributes. |
FileValue | Prorigo.Protrak.API.Contracts.FileValue | Value for Attachment attributes. Contains FileId and FileName. |
UserValues | Prorigo.Protrak.API.Contracts.UserValue[] | Value for User attributes. Array of UserId, UserName, UserEmail, UserThumbnailUrl, Phone. |
ReferenceValues | ReferenceValue[] | Value for Reference attributes. Array of related instance Id and Name. |
OptionValues | Prorigo.Protrak.API.Contracts.Enum.OptionValues | Enum indicating if the option value is StaticList, Roles, Types or Templates. |
TemplateTarget | string | If OptionValues is set to Templates, then TemplateTarget is used to filter available templates based on the specified template target. |
Attribute Type Capabilities
| Attribute Type | Sortable | Default Sort Order | Filterable | Conditions |
|---|---|---|---|---|
| Text | yes | Ascending | yes | Contains, Not Contains, Equals, Not Equals, In, Is Empty, Is Not Empty, Starts With, Ends With |
| Numeric | yes | Ascending | yes | Equals, Greater Than, Greater Than Or Equal, Less Than, Less Than Or Equal, Between, Is Empty, Is Not Empty, In |
| Date | yes | Descending | yes | Equals, Greater Than, Greater Than Or Equal, Less Than, Less Than Or Equal, Between, Is Empty, Is Not Empty |
| Currency | yes | Ascending | yes | Equals, Greater Than, Greater Than Or Equal, Less Than, Less Than Or Equal, Between, Is Empty, Is Not Empty |
| Picklist | yes | Ascending | yes | Contains, Not Contains, Equals, Not Equals, Is Empty, Is Not Empty |
| Picklist - Multiselect | no | yes | Contains, Not Contains, Equals, Not Equals, Is Empty, Is Not Empty | |
| DateTime | yes | Descending | yes | Equals, Greater Than, Greater Than Or Equal, Less Than, Less Than Or Equal, Between, Is Empty, Is Not Empty |
| RichText | yes | Ascending | yes | Contains, Is Empty, Is Not Empty |
| Expression | no | no | ||
| Boolean | yes | Ascending | yes | Equals |
| Attachment | no | no | ||
| User | yes | Ascending | yes | ContextUser, Contains, Not Contains, Equals, Not Equals, Is Empty, Is Not Empty |
| User - Multiselect | no | yes | ContextUser, Contains, Not Contains, Equals, Not Equals, Is Empty, Is Not Empty | |
| Reference | no | yes | Contains, Not Contains, Equals, Not Equals, In, Is Empty, Is Not Empty, Starts With, Ends With | |
| Name | yes | Ascending | yes | Contains, Not Contains, Equals, Not Equals, In, Is Empty, Is Not Empty, Starts With, Ends With |
| TrackingId | yes | Ascending | yes | Contains, Not Contains, Equals, Not Equals, In, Is Empty, Is Not Empty, Starts With, Ends With |
| TrackingInfo | yes | Ascending | yes | Contains, Not Contains, Equals, Not Equals, In, Is Empty, Is Not Empty, Starts With, Ends With |
| Geolocation | no | no | ||
| Description | yes | Ascending | yes | Contains, Not Contains, Equals, Not Equals, In, Is Empty, Is Not Empty |
| State | yes | Ascending | yes | |
| Actions | no | no | ||
| Creator | yes | Ascending | yes | ContextUser, Contains, Not Contains, Equals, Not Equals, Is Empty, Is Not Empty |
| Modifier | yes | Ascending | yes | ContextUser, Contains, Not Contains, Equals, Not Equals, Is Empty, Is Not Empty |
| Created | yes | Descending | yes | Equals, Greater Than, Greater Than Or Equal, Less Than, Less Than Or Equal, Between, Is Empty, Is Not Empty |
| Modified | yes | Descending | yes | Equals, Greater Than, Greater Than Or Equal, Less Than, Less Than Or Equal, Between, Is Empty, Is Not Empty |
| TypeName | no | no | ||
| VersionNumber | no | no | ||
| QRCode | no | no |