It is simple to configure NoahFace to sync users from Google Sheets. To do this, complete the following steps:
1. From within your Google Sheet of employees, select: Extensions / Apps Script:
2. Create a script with a doGet() function which constructs and returns a JSON array of users:
function doGet() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var rows = sheet.getDataRange().getValues();
var users = [];
for (var i = 1; i < rows.length; i++) {
var user = {};
user.SyncGuid = rows[i][0].toString();
user.UserNumber = rows[i][0].toString();
user.FirstName = rows[i][1];
user.LastName = rows[i][2];
user.Email = rows[i][3];
user.Site = rows[i][4];
user.Groups = rows[i][5].split(";");
users.push(user);
}
var body = {Users: users};
return ContentService.createTextOutput(JSON.stringify(body)).setMimeType(ContentService.MimeType.JSON);
}
The only required attributes for each user are: SyncGuid, FirstName, and LastName. For a full list of attributes see: Open APIs.
3. Select Deploy / New Deployment, provide a Description, provide Access to "Anyone", and select Deploy:
4. Copy the Web app URL:
5. Add a Synchronization within the NoahFace Dashboard, assign a Type of "Custom" and assign your User list url:
That's it! Just set a schedule and NoahFace will automatically sync your users from your Google Sheet.