iCloud.recordCreate()

Type Function
Return value CloudKitRecord
Revision Release 2022.3683
Keywords iCloud, sync, storage, CloudKit, recordCreate
See also iCloud.recordCreateZone()
iCloud.recordDelete()
CloudKitRecord
CloudKitRecord:save()
CloudKitRecord:set()
iCloud.*

Overview

Creates and returns a new CloudKitRecord object.

Important

The created object is not stored in the CloudKit database. Use CloudKitRecord:save() to send it to the database.

Syntax

iCloud.recordCreate( params )
params (required)

Table. Table containing method-specific parameters — see the next section for details.

Parameter Reference

Valid keys for the params table include:

Example

local recordData = {
    -- String and number values can be passed directly (convenience method)
    company = "Corona Labs",
    amount = 1,
    -- Other value types must be passed as a table
    where = { type="location", latitude=37.453139, longitude=122.113451 }
}

local record = iCloud.recordCreate(
    {
        type = "company",
        recordName = "Corona Labs 1",
        table = recordData
    }
)

record:save()