0

I've figured out how to query for some metadata for example calling this in my query:

<td>" + record['created'].value + "</td> <-- populates some table data

But this comes back undefined which confuses me because the CloudKit dashboard has a value for Created By (as part of the automatic Metadata that is created with each record.)

How do I query for the ID/UUID as well as get the response in a HTML/JS-readable manner?

SamYoungNY
  • 6,444
  • 6
  • 26
  • 43
  • With Dave's help I wrote a query to get the timestamp, it looks like this: `" + record['created'].timestamp + "` – SamYoungNY Jun 25 '15 at 18:16

1 Answers1

1

After fetching one or more records with CloudKit.js you'll notice you get back an Object that looks like this:

{
    "recordName": "6E863D3D-5371-4376-A9BA-3B294F480E4E",
    "recordType": "Message",
    "fields": {
        "text": {
            "value": "hi",
            "type": "STRING"
        },
    },
    "recordChangeTag": "ib461v1s",
    "created": {
        "timestamp": 1434751588720,
        "userRecordName": "_36ed4b61e7a11c9302f851fe25a9b911",
        "deviceID": "_2"
    },
    "modified": {
        "timestamp": 1434751588720,
        "userRecordName": "_36ed4b61e7a11c9302f851fe25a9b911",
        "deviceID": "_2"
    }
}

The recordName is a record's unique identifier, and the Object has a created attribute which points to an Object with a timestamp field.

Dave Browning
  • 1,256
  • 7
  • 7