Common Resources - How to Convert a Date into the Desired Format

While the Common Resources UI supports configuring a given field as type date, you must use the Common Resource API to coerce the date format from the provider into the desired format.

First, create a Common Resource, with at least one field defined/mapped (the date field).  For the date field, select the 'field settings' gear wheel and set the type to 'date'.

Next, from the platform API documentation, get the transformation via API (GET /organizations/elements/{keyOrId}/transformations/{objectName}).  Find the date field in the fields array and add or update the field configuration to include a type called 'transformDate'.  In the transformDate configuration, the vendor pattern is the date pattern that is returned by the provider, and the pattern is how the date will be returned when calling the Common Resource.  Note - Sugar Integrate uses Java Date Time Format, so both the pattern and vendor pattern will need to use this format.

{
      "type": "date",
      "path": "lastModified",
      "level": "organization",
      "vendorPath": "whenmodified",
      "vendorType": "date",
      "configuration": [
        {
          "type": "passThrough",
          "properties": {
            "toVendor": true,
            "fromVendor": true
          }
        },
        {
          "type": "transformDate",
          "properties": {
            "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'",
            "vendorPattern": "MM/dd/yyyy HH:mm:ss"
          }
        }
      ]
    }

Last, update the transformation by calling PUT /organizations/elements/{keyOrId}/transformations/{objectName}.