Purpose
This Google Apps script allows for calling the Alma POL API and using Google Forms data from a Google Sheet to create a physical one-time POL with a brief bib and item record in Alma.
Setup
-
Clone the repo and/or download
alma-create-pol.js
. -
Create or modify an existing Google Sheets document that includes a tab with form submissions as follows:
a. Create a tab called
config
.b. This sheet should have the following column headers:
-
apiKey
-
spreadsheetTab
c. Include your API key from the Ex Libris Developer Network in the first row under the
apiKey
column.d. Include the name of the tab in the current spreadsheet where the form submission data is recorded.
e. Your
config
tab should look as follows:f. Create a tab called
locationMapping
with a column for location code and a column for library code.g. Create a tab called
authorizedUsers
with a column of email addresses of users who you are allowing to create POLs using the Google Form. -
-
Now open the Script Editor under the Tools menu in Sheets, and create a new project (following the relevant instructions here).
-
Select
New
-->Script
from theFile
menu, and paste in the code fromalma-create-pol.js
. -
Modify the line of code
var spreadsheet = SpreadsheetApp.openById('');
to include the ID string of your Google Sheet. (The ID is the long identifier described on this page of the Google Sheets API documentation.) Make sure your spreadsheet ID is between the quotes in this line of code. Then save the code by clicking the floppy disk icon. -
Modify the lines of code mapping variables to cells as needed to ensure that column numbers correspond to the correct columns in the form responses sheet.
-
Set up a project trigger to run the createPol function on form submission.