次ã«ç¤ºããµã³ãã« JSON ãã¤ãã¼ãã§ã¯、(cell ãã£ã¬ã¯ãã£ãã«ãã£ã¦)ã»ã«ã®å¤ªåå±æ§ã true ã«è¨å®ãããªã¯ã¨ã¹ããè¡ã£ã¦ãã¾ã。ãã®éã®ãã£ã¼ã«ã ãã¹ã¯(fields)ã¯、ãªã¯ã¨ã¹ããç¹°ãè¿ãã¦ããããã«ãè¦ãã¾ã。
{
"repeatCell": {
"range": {
"endRowIndex": 1
},
"cell": {
"userEnteredFormat": {
"textFormat": {
"bold": true
}
}
},
"fields": "userEnteredFormat/textFormat/bold",
}
}
「ããã¯åé·ã§ã¯ãªãã?」ã¨æãããããã¾ãã。ããã、ä¸ã®ä¾ã¯ 2 ã¤ã®é¨åãããªãç¹ã«æ³¨ç®ãã¦ãã ãã。1)ãªã¯ã¨ã¹ããæãå¤æ´ç¹ã«ã¤ãã¦ã®ãã¼ã¿ãæä¾ãã¾ã。2)ãã¨ãã°、1 è¡ç®ã®ãã¹ã¦ã®ã»ã«ã®
userEnteredFormat/textFormat/bold å±æ§ã¨ãããããªå½¢ã§、ãã£ã¼ã«ã ãã¹ã¯ã§ä½ãã¢ãããã¼ãããããæå®ãã¾ã。ããå°ãæ示çã«èª¬æããããã«、æä½ã®ãããªå¥ã®ãã¹ã¯ã追å ãã¦ã¿ã¾ããã。ããã§ã¢ãããã¼ã ãã£ã¼ã«ã ãã¹ã¯ã«、太åã¨æä½ã®ä¸¡æ¹ã®ãã£ã¼ã«ããè¨å®ããã¾ãã。
"fields": "userEnteredFormat/textFormat(bold,italic)"
ãã ã、ãã£ã¼ã«ã ãã¹ã¯ã«ä¸¡æ¹ã®è¦ç´ ãåå¨ãã¦ã、ã¢ãããã¼ã ãã¼ã¿ãæä¾ãã¦ããã®ã¯å¤ªåã ãã§ã。ãªã¯ã¨ã¹ãæ¬ä½ã«ã¯、italic ãè¨å®ãããã¼ã¿ã¯æå®ããã¦ãã¾ãã。ãã®å ´å、ãã¹ã¦ã®ã»ã«ããªã»ããããã¾ã。ã¤ã¾ã、ã»ã«ããã¨ãã¨æä½ã«ãªã£ã¦ããã°、API ãªã¯ã¨ã¹ãã®å®äºå¾ã«æä½ã解é¤ããã¾ã。éã«、æåããã»ã«ãæä½ã«ãªã£ã¦ããªãå ´åã¯、ã»ã«ã¯ãã®ã¾ã¾ã«ãªãã¾ã。ãã®æ©è½ã使ãã¨、ããã»ã«ã®ç¯å²ãå
ã«æ»ããã、以åã®è¨å®ããªã»ãããããããæ©è½ãå®ç¾ã§ãã¾ã。ãã®ä»ã®ä¾ã、ã¢ãããã¼ã ãªã¯ã¨ã¹ãã¸ã®ãã£ã¼ã«ã ãã¹ã¯ã®æ´»ç¨æ¹æ³ã«ã¤ãã¦ã¯、å
ã»ã©ã®åç»ãã覧ãã ãã。
ãã£ã¼ã«ã ãã¹ã¯ã使ã£ã¦ API ãã¤ãã¼ãã®é¨åçãªå¿çãåå¾ããæ¹æ³ã®è©³ç´°ã«ã¤ãã¦ã¯、
ãã¡ãã®åç» ã 2 åã·ãªã¼ãºã® 1 åç®ã®
æ稿 ãã覧ãã ãã。両æ¹(èªã¿åãããã³ã¢ãããã¼ã)ã®ã¦ã¼ã¹ã±ã¼ã¹ã«é¢ããç·åçãªè¨äºã«ã¤ãã¦ã¯、Google Slides API ããã¥ã¡ã³ãã®
ã¬ã¤ã ãã覧ãã ãã。 ãã²ãã£ã¼ã«ã ãã¹ã¯ãã楽ãã¿ãã ãã!
Posted by
Eiji Kitamura - Developer Relations Team
ãã®è¨äºã¯ G Suite ãããããã¼ã¢ããã±ã¼ã、Wesley Chun(@wescpy)ã«ãã G Suite Developers Blogã®è¨äº "Using field masks with update requests to Google APIs " ãå
ã«ç¿»è¨³・å çãããã®ã§ã。詳ããã¯å
è¨äºãã覧ãã ãã。
å
æ¥、Google API ã«å¯¾ãã¦èªã¿åã(GET)ãªã¯ã¨ã¹ããå¼ã³åºãéã«、ãã£ã¼ã«ã ãã¹ã¯ã使ã£ã¦ ã¬ã¹ãã³ã¹ ãã¤ãã¼ãã¨ãã¦è¿ããããã¼ã¿éãåæ¸ããæ¹æ³ãç´¹ä»ãã¾ãã。æ¬æ¥(*åæå
¬éå½æ)ã¯、ãã£ã¼ã«ã ãã¹ã¯ã®å¥ã®ã¦ã¼ã¹ã±ã¼ã¹ã§ããã¢ãããã¼ã ãªã¯ã¨ã¹ãã«ã¤ãã¦ç´¹ä»ãã¾ããã。
ãã®ã·ããªãªã§ã¯、以åã¨ä¼¼ã¦ãããã®ã®、å°ãç°ãªãç®çã§ãã£ã¼ã«ã ãã¹ã¯ãå©ç¨ãã¾ã。ãã®æ¹æ³ã使ãå ´å、ãã£ã¼ã«ã ãã¹ã¯ã¯ãã£ã«ã¿ã¼ã¨ãã¦åä½ãã¾ãã、ã©ã¡ããã¨ããã°、ã©ã® API ãã£ã¼ã«ããã¢ãããã¼ãããããå¶å¾¡ããããããã¹ã¯ã®ãããªåãã«ãªãã¾ã。次ã®åç»ã§ã¯、Google Sheets API 㨠Slides API ã使ã£ãããã¤ãã®ä¾ãæãã¦ã¢ãããã¼ã ãã£ã¼ã«ã ãã¹ã¯ã®ä½¿ç¨æ¹æ³ã«ã¤ãã¦èª¬æãã¦ãã¾ã。ãã²ã覧ãã ãã。
VIDEO
次ã«ç¤ºããµã³ãã« JSON ãã¤ãã¼ãã§ã¯、(cell ãã£ã¬ã¯ãã£ãã«ãã£ã¦)ã»ã«ã®å¤ªåå±æ§ã true ã«è¨å®ãããªã¯ã¨ã¹ããè¡ã£ã¦ãã¾ã。ãã®éã®ãã£ã¼ã«ã ãã¹ã¯(fields)ã¯、ãªã¯ã¨ã¹ããç¹°ãè¿ãã¦ããããã«ãè¦ãã¾ã。
{
"repeatCell": {
"range": {
"endRowIndex": 1
},
"cell": {
"userEnteredFormat": {
"textFormat": {
"bold": true
}
}
},
"fields": "userEnteredFormat/textFormat/bold",
}
}
「ããã¯åé·ã§ã¯ãªãã?」ã¨æãããããã¾ãã。ããã、ä¸ã®ä¾ã¯ 2 ã¤ã®é¨åãããªãç¹ã«æ³¨ç®ãã¦ãã ãã。1)ãªã¯ã¨ã¹ããæãå¤æ´ç¹ã«ã¤ãã¦ã®ãã¼ã¿ãæä¾ãã¾ã。2)ãã¨ãã°、1 è¡ç®ã®ãã¹ã¦ã®ã»ã«ã® userEnteredFormat/textFormat/bold å±æ§ã¨ãããããªå½¢ã§、ãã£ã¼ã«ã ãã¹ã¯ã§ä½ãã¢ãããã¼ãããããæå®ãã¾ã。ããå°ãæ示çã«èª¬æããããã«、æä½ã®ãããªå¥ã®ãã¹ã¯ã追å ãã¦ã¿ã¾ããã。ããã§ã¢ãããã¼ã ãã£ã¼ã«ã ãã¹ã¯ã«、太åã¨æä½ã®ä¸¡æ¹ã®ãã£ã¼ã«ããè¨å®ããã¾ãã。
"fields": "userEnteredFormat/textFormat(bold,italic)"
ãã ã、ãã£ã¼ã«ã ãã¹ã¯ã«ä¸¡æ¹ã®è¦ç´ ãåå¨ãã¦ã、ã¢ãããã¼ã ãã¼ã¿ãæä¾ãã¦ããã®ã¯å¤ªåã ãã§ã。ãªã¯ã¨ã¹ãæ¬ä½ã«ã¯、italic ãè¨å®ãããã¼ã¿ã¯æå®ããã¦ãã¾ãã。ãã®å ´å、ãã¹ã¦ã®ã»ã«ããªã»ããããã¾ã。ã¤ã¾ã、ã»ã«ããã¨ãã¨æä½ã«ãªã£ã¦ããã°、API ãªã¯ã¨ã¹ãã®å®äºå¾ã«æä½ã解é¤ããã¾ã。éã«、æåããã»ã«ãæä½ã«ãªã£ã¦ããªãå ´åã¯、ã»ã«ã¯ãã®ã¾ã¾ã«ãªãã¾ã。ãã®æ©è½ã使ãã¨、ããã»ã«ã®ç¯å²ãå
ã«æ»ããã、以åã®è¨å®ããªã»ãããããããæ©è½ãå®ç¾ã§ãã¾ã。ãã®ä»ã®ä¾ã、ã¢ãããã¼ã ãªã¯ã¨ã¹ãã¸ã®ãã£ã¼ã«ã ãã¹ã¯ã®æ´»ç¨æ¹æ³ã«ã¤ãã¦ã¯、å
ã»ã©ã®åç»ãã覧ãã ãã。
ãã£ã¼ã«ã ãã¹ã¯ã使ã£ã¦ API ãã¤ãã¼ãã®é¨åçãªå¿çãåå¾ããæ¹æ³ã®è©³ç´°ã«ã¤ãã¦ã¯、ãã¡ãã®åç» ã 2 åã·ãªã¼ãºã® 1 åç®ã®æ稿 ãã覧ãã ãã。両æ¹(èªã¿åãããã³ã¢ãããã¼ã)ã®ã¦ã¼ã¹ã±ã¼ã¹ã«é¢ããç·åçãªè¨äºã«ã¤ãã¦ã¯、Google Slides API ããã¥ã¡ã³ãã®ã¬ã¤ã ãã覧ãã ãã。 ãã²ãã£ã¼ã«ã ãã¹ã¯ãã楽ãã¿ãã ãã!
Posted by Eiji Kitamura - Developer Relations Team