我正在从 Apps Script 调用 Zoom API,它返回的数据如下:
{
"page_count": 1,
"page_size": 30,
"total_records": 25,
"next_page_token": "",
"participants": [
{
"id": "w8fMI8zCSl2O8iO91xxxx",
"user_id": "16778xxx",
"name": "Full Name Here",
"user_email": "email1@gmail.com",
"join_time": "2020-10-16T15:20:30Z",
"leave_time": "2020-10-16T15:27:16Z",
"duration": 406,
"attentiveness_score": ""
},
{
"id": "X-1nXsOESVSK3o-7uyxxxx",
"user_id": "16783xxx",
"name": "Second Full Name Here ",
"user_email": "email2@gmail.com",
"join_time": "2020-10-16T15:20:39Z",
"leave_time": "2020-10-16T15:27:57Z",
"duration": 438,
"attentiveness_score": ""
},
{
"id": "FO8ocbGgSY2uUADrT6xxxx",
"user_id": "16784xxx",
"name": "Full Name3Has 2Middle Names",
"user_email": "email@gmail.com",
"join_time": "2020-10-16T15:20:39Z",
"leave_time": "2020-10-16T15:27:15Z",
"duration": 396,
"attentiveness_score": ""
},
{
"id": "3YIYyN51SC6YboiM8Dxxxx",
"user_id": "16785xxx",
"name": "Full Name 4",
"user_email": "email4@gmail.com",
"join_time": "2020-10-16T15:20:40Z",
"leave_time": "2020-10-16T15:25:13Z",
"duration": 273,
"attentiveness_score": ""
}
]
}
ETC
我想处理数据并将每个学生的信息从左到右排成一行:
Student Name, Email, Join time, Leave time, Duration
因为姓名和电子邮件等不是标准长度,甚至不是标准数量的单词,所以我尝试使用“拼接”失败了。
有没有办法让我通过编程方式来处理它:
在 "name":" 之后和下一个引号 (") 标记之前制作字符串部分的数组。然后,"user_email":
在下一个引号(“)标记之后和之前的部分......等等
或者其他使这些数据可用的方法?