Type Function Object CloudKitRecord Return value Table Revision Release 2025.3721 Keywords iCloud, sync, storage, CloudKit, CloudKitRecord, get See also CloudKitRecord CloudKitRecord:set() CloudKitRecord:table() iCloud.*
Retreives the value of a specific field in a record. Because Lua data types do not directly match CloudKit data types, CloudKit record values are packaged and returned as a table. This table will contain specific properties depending on the record value’s type — see Record Values below for details.
CloudKitRecord:get( field )
String. The field name to retreive the value from.
The returned table has a type property and its contents vary depending on this property value. Here is the outline for each represented type:
local function fetchResults( event )
if event.record then
local value = event.record:get( "meeting" )
if ( value and value.type == "string" ) then
print( "Meeting:", value.string )
end
end
end
iCloud.recordFetch(
{
recordName = "Corona Labs 1",
onComplete = fetchResults
}
)
local function fetchResults( event )
if event.record then
local value = event.record:get( "when" )
if ( value and value.type == "date" ) then
print( "When:", value.time )
end
end
end
iCloud.recordFetch(
{
recordName = "Corona Labs 1",
onComplete = fetchResults
}
)
local function fetchResults( event )
if event.record then
local value = event.record:get( "where" )
if ( value and value.type == "location" ) then
print( "Where:", value.latitude .. ", " .. value.longitude )
end
end
end
iCloud.recordFetch(
{
recordName = "Corona Labs 1",
onComplete = fetchResults
}
)