Created
October 3, 2016 06:57
-
-
Save shingorow/bd232e7278b6ce7ef08d4345dccf45ca to your computer and use it in GitHub Desktop.
フルネームを姓と名にわけるウェブツールの API を利用するための G Suite Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getSeparatedNames() { | |
var ss = SpreadsheetApp.getActive(); | |
var sheet = ss.getActiveSheet(); | |
var range = sheet.getRange('A:A'); | |
var values = range.getValues(); | |
var data = Array.prototype.concat.apply([], values); | |
var params = { | |
method: 'post', | |
payload: JSON.stringify(data) | |
} | |
var url = 'https://separate-name.katsushikatech.net/api/get_separated_names'; | |
var res = JSON.parse(UrlFetchApp.fetch(url, params)); | |
var destRange = sheet.getRange(1, 2, res.length, res[0].length); | |
destRange.setValues(res); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment