2015-05-28 97 views
0

我試圖將以下json對象轉換爲表格,但Corona未能這樣做並給出打印0。我嘗試用「」替換「__type」:「Object」,以防止混淆,但沒有運氣。Corona未將json轉換爲表格

tempTable1 = '{"result":[{"__type":"Object","address":"95-97 Whitehorse Rd Blackburn VIC 3130","className":"allJobs","content":"Dr test","coord":{"__type":"GeoPoint","latitude":-37.817272,"longitude":145.149913},"createdAt":"2015-05-21T05:15:45.012Z","done":false,"email":"na","job":"psychologist","objectId":"PfKJkmIQKw","order":1,"phone":"0422031410","postcode":"3130","suburb":"Blackburn VIC","updatedAt":"2015-05-27T08:15:46.607Z","web":"na"},{"__type":"Object","address":"Suite 9 10-12 Prospect St Box Hill ","className":"allJobs","content":"Dr 2)","coord":{"__type":"GeoPoint","latitude":-37.817957,"longitude":145.118997},"createdAt":"2015-05-21T05:17:56.382Z","done":false,"email":"[email protected]","job":"lawyer","objectId":"xnLABEm5S4","order":1,"phone":"03 9890 0797","postcode":"3128","suburb":"Box Hill VIC","updatedAt":"2015-05-27T08:15:21.112Z","web":"na"}]}' 


local tables = json.decode(tempTable1) 
print(#tables) 

回答

0

我以錯誤的方式調用結果。因爲它在其他表格中創建了一些表格。以下是正確的。

print (event.response.result[5].email) 
print (event.response.result[5].coord.latitude)