我是新手,答案很简单,但请帮助。
我从查询中返回以下内容,这是结果的jsonParse
{"totalSize":1,
"done":true,
"records":
[{"attributes":
{
"type":"Account",
"url":"/services/data/v21.0/sobjects/Account/001C0000012Z8Y5IAK"
},
"Id":"001C0000012Z8Y5IAK"
}]
}
如何在Id
时将totalSize = 1
最后提取到变量中?
答案 0 :(得分:1)
objectName.records [0] .Id会做的伎俩。适当增加记录索引。
样本 -
var sforceResponse = {"totalSize":1,"done":true,"records":[{"attributes":{"type":"Account","url":"/services/data/v21.0/sobjects/Account/001C0000012Z8Y5IAK"},"Id":"001C0000012Z8Y5IAK"}]}
sforceResponse.records[0].Id //this variable contains the Id.