An app tool to streamline the creation and management of CEDAR metadata templates that works seamlessly with Google Sheets.
This step-by-step instruction will guide you to install the app tool from its source code to your own spreadsheet in Google Sheets.
-
Install clasp.
npm install -g @google/clasp
-
Enable the Google Apps Script API by visiting https://script.google.com/home/usersettings.
-
Login to your Google Drive account to enable the CLI commands.
clasp login
-
Clone this project to your local machine.
git clone https://github.com/metadatacenter/cedar-template-builder-for-gsheet.git
-
Create a new spreadsheet file in your project folder in Google Drive.
-
In your spreadsheet, go to Extensions > Apps Script to open the script editor.
-
In the Apps Script editor, go to Project Settings from the left-hand menu bar and copy the Script ID using the "Copy" button.
-
Navigate to the project folder and link it to your remote Apps Script project using the Script ID.
$ cd cedar-template-builder-for-gsheet $ clasp clone [PASTE SCRIPT ID HERE] --rootDir `pwd`
-
Push the files to the Apps Script project.
clasp push
-
Refresh the spreadsheet to activate the code.
Follow this instruction to set up the environment variables and initialize the tool for the first time.
-
Select Extensions > Apps Script and navigate to Project Settings. Scroll down to locate Script Properties.
-
Add the following properties and their values.
Property Value glossary.fields.index_column 2 glossary.valuesets.index_column 3 template.index_column 2 value_selection_limit 100 value_selection_offset 25 -
Go back to the spreadsheet and select Automation > New metadata specification... from the spreadsheet menu. Resolve any authorization prompts that appear.
-
Executing the create a new metadata specification command for the first time will trigger the auto-generation of 3 system-required sheets for storing the fields, value sets and prefixes:
.FIELDS
: Used to store reusable template fields..VALUESETS
: Used to store the value sets..PREFIXES
: Used to store concept prefixes referenced in value sets.
-
Enter a preferred name for the new metadata specification in the dialog box. This will automatically generate a new sheet where you can define the specification.
-
Share the spreadsheet with the setting "Anyone with the link" and grant at least Viewer access to grant a read access to third-party APIs.
Follow the workflow below to contribute on the code development of this software.
-
Navigate to the project folder and make a new branch and switch to it.
git checkout -b feat/xyz
-
Write your code using the Apps Script editor in the browser.
-
Download the new code to your local project folder.
clasp pull
-
Create a commit.
$ git add . $ git commit -m "Add a detailed commit message describing your changes."
-
Push the branch to GitHub.
git push --set-upstream origin feat/xyz
-
Create the pull request.
gh pr create --base main --head feat/xyz --title "Your PR title" --body "Detailed description of the changes"
-
Or alternatively, you can visit the project GitHub page from the browser to create the pull request interactively.