Description
When retrieving worksheet content or field definitions via the REST API, both Date/Time and Timestamp fields appear with type set to datetime. This is by design: both share the same underlying data type. Timestamp fields can be identified by the autoCreated attribute being true, indicating the value is automatically set to the current date/time.
Solution
Use the following approach when interpreting worksheet fields from API responses:
- Call GET /worksheet/{eid} or GET /worksheet/{eid}/_fields
- For each field with type equal to datetime, check the autoCreated attribute
- If autoCreated is true, treat the field as a Timestamp (auto-created datetime)
- If autoCreated is absent or false, treat the field as a standard Date/Time
- Adjust client logic or mapping to use autoCreated to distinguish display and behavior
Sample timestamp field definition:
{
"key": "db2bcbff-a595-4dc0-aec8-4426a60d4a60",
"title": "Timestamp",
"type": "datetime",
"clearValueOnPaste": true,
"allowEndUserEntry": false,
"readOnly": false,
"requiresReasonOnChange": false,
"isRequiredOnCompletion": false,
"autoCreated": true
}
Sample DateTime field definition:
{
"key": "a4aff47c-a8a8-46cf-a7df-55a73df0d8d4",
"title": "My DateTime Field",
"type": "datetime",
"clearValueOnPaste": true,
"allowEndUserEntry": false,
"readOnly": false,
"requiresReasonOnChange": false,
"isRequiredOnCompletion": false
}
Comments
0 comments
Article is closed for comments.