|
[Return Home](home)
|
|
[Return Home](home)
|
|
# "config.json" File Parameters
|
|
# "config.json" File Parameters
|
|
By default, two backups configurations are defined, a merged document file containing emergency student information and also a spreadsheet of the same student data. You can define more or remove ones that you do not want here in this JSON file. All parameters are required unless specified otherwise.
|
|
By default, two backups configurations are defined, a merged document file containing emergency student information and also a spreadsheet of the same student data. You can define more or remove ones that you do not want here in this JSON file. All parameters are required unless specified otherwise.
|
|
- `type:` Enter either `"mergedoc"` or `"sheet"` to define the type of export.
|
|
|
|
- `"mergedoc"` will create a document with a page for each row of data from the PowerQuery using the DOCX template. The template file uses standard Mail Merge syntax.
|
|
|
|
- `"sheet"` will create a spreadsheet with the data from the query.
|
|
|
|
- `powerschool:` Enter information for your PowerSchool server instance here.
|
|
- `powerschool:` Enter information for your PowerSchool server instance here.
|
|
- `api:` Define the API URL and credentials in this section.
|
|
- `api:` Define the API URL and credentials in this section.
|
|
- `base_url:` Enter the base url for your PowerSchool server here.
|
|
- `base_url:` Enter the base url for your PowerSchool server here.
|
|
- `credential_file:` Enter the file name containing the "client_id" and "client_secret" in JSON format for authentication.
|
|
- `credential_file:` Enter the file name containing the "client_id" and "client_secret" in JSON format for authentication.
|
|
- `query:` Use this section to select and define options for the PowerQuery.
|
|
|
|
- `name:` Enter the query name from the PowerQuery here (for example `"org.psugIL.PowerSchool.Backup.studentsFull"`)
|
|
|
|
- `header:` _(Optional)_ Use this to re-order, re-name, or define specific columns to retrieve from the PowerQuery. This is in a dictionary format with the PowerQuery field name on the left and the display name on the right, like so: `"header:" { "first_name": "first", "last_name": "last" }`
|
|
|
|
- `split:` _(Optional, if Adam is able to implement)_ Use this to split the output into multiple files based on one or more columns in the output. Use the display name defined in the header section if you defined one, otherwise use the PowerQuery field name. This is defined using a list format, like so: `
|
|
|
|
"split": [ "school_abbreviation", "grade_level" ]`
|
|
|
|
- `google:` _(Optional)_ Use this to configure your connection to the Google API if you will be uploading the documents to Google Drive.
|
|
- `google:` _(Optional)_ Use this to configure your connection to the Google API if you will be uploading the documents to Google Drive.
|
|
- `credentials:` Name of the JSON file containing the API Service Account Key.
|
|
- `credentials:` Name of the JSON file containing the API Service Account Key.
|
|
- `folder:` After sharing the Google Drive folder with the API service account, get the sharable link. The Folder ID is found in the URL. This is everything that comes after `“folder/”` in the URL. For example, if the URL was `“https://drive.google.com/drive/folders/1dyUEebJaFnWa3Z4n0BFMVAXQ7mfUH11g”`, then the Folder ID would be `“1dyUEebJaFnWa3Z4n0BFMVAXQ7mfUH11g”`.
|
|
- `folder:` After sharing the Google Drive folder with the API service account, get the sharable link. The Folder ID is found in the URL. This is everything that comes after `“folder/”` in the URL. For example, if the URL was `“https://drive.google.com/drive/folders/1dyUEebJaFnWa3Z4n0BFMVAXQ7mfUH11g”`, then the Folder ID would be `“1dyUEebJaFnWa3Z4n0BFMVAXQ7mfUH11g”`.
|
|
|
|
- `jobs` Define your jobs here
|
|
|
|
- `type:` Enter either `"mergedoc"` or `"sheet"` to define the type of export.
|
|
|
|
- `"mergedoc"` will create a document with a page for each row of data from the PowerQuery using the DOCX template. The template file uses standard Mail Merge syntax.
|
|
|
|
- `"sheet"` will create a spreadsheet with the data from the query.
|
|
|
|
- `template:` (Only if type of `"mergedoc"`) Name of the DOCX file containing the template for creating the merged documents.
|
|
|
|
- `powerschool:` Here you will define which query to run and any arguments
|
|
|
|
- `query:` Use this section to select and define options for the PowerQuery.
|
|
|
|
- `name:` Enter the query name from the PowerQuery here (for example `"org.psugIL.PowerSchool.Backup.studentsFull"`)
|
|
|
|
- `headers:` _(Optional)_ Use this to re-order or define specific columns to retrieve from the PowerQuery. This is in a dictionary format with the PowerQuery field name on the left and the display name on the right, like so: `"header:" { "first_name": "first", "last_name": "last" }`
|
|
|
|
- `headers (renaming option)` _(Optional)_ Use this to re-name columns. This is in a dictionary format with the PowerQuery field name on the left and the display name on the right, like so: `"headers (renaming option)": [
|
|
|
|
{"field1": "new_field_1"},
|
|
|
|
{"field2": "new_field_2"},
|
|
|
|
{"field3": "new_field_3"}
|
|
|
|
],`
|
|
|
|
- `split:` Use this to split the output into multiple files based on one of the columns in the output. Use the display name defined in the header section if you defined one, otherwise use the PowerQuery field name.
|
|
|
|
- `google:` _(Optional)_ Use this to configure your connection to the Google API if you will be uploading the documents to Google Drive.
|
|
- `file:` Define the file name here. If you used a split, the value in the column(s) you are splitting on will be prepended to the file name.
|
|
- `file:` Define the file name here. If you used a split, the value in the column(s) you are splitting on will be prepended to the file name.
|
|
- `sheet:` _(Only if type of "sheet")_ Name of the tab for the sheet in the file to insert the data.
|
|
- `sheet:` _(Only if type of "sheet")_ Name of the tab for the sheet in the file to insert the data.
|
|
- `clear:` _(Only if type of "sheet")_ Boolean true or false if the sheet should be cleared prior to upload. _Note: Do not surround true or false with quotation marks here._
|
|
- `clear:` _(Only if type of "sheet")_ Boolean true or false if the sheet should be cleared prior to upload. _Note: Do not surround true or false with quotation marks here._
|
|
- `ref:` _(Only if type of "sheet")_ Enter the cell reference to begin inserting the data in the sheet. Normally "A1".
|
|
- `ref:` _(Only if type of "sheet")_ Enter the cell reference to begin inserting the data in the sheet. Normally "A1".
|
|
- `template:` (Only if type of `"mergedoc"`) Name of the DOCX file containing the template for creating the merged documents.
|
|
- `local:`
|
|
- `output:` Name of the DOCX (for type of `"mergedoc"`) or XLSX (for type of `"sheet"`) file for the file output.
|
|
- `file:` Name of the DOCX (for type of `"mergedoc"`) or XLSX (for type of `"sheet"`) file for the file output.
|
|
|
|
- `sheet:` _(Only if type of "sheet")_ Name of the tab for the sheet in the file to insert the data.
|
|
|
|
- `clear:` _(Only if type of "sheet")_ Boolean true or false if the sheet should be cleared prior to upload. _Note: Do not surround true or false with quotation marks here._
|
|
|
|
|
|
**Example "config.json" file contents**
|
|
**Example "config.json" file contents**
|
|
```
|
|
```
|
|
[
|
|
|
|
{
|
|
{
|
|
"type": "mergedoc",
|
|
|
|
"powerschool": {
|
|
"powerschool": {
|
|
"api": {
|
|
"api": {
|
|
"base_url": "powerschool.domain.com",
|
|
"base_url": "applegrove.powerschool.com",
|
|
"credential_file": "ps.json"
|
|
"one of these": [
|
|
|
|
"client_id and client_secret",
|
|
|
|
"access_token",
|
|
|
|
"credential_file",
|
|
|
|
"plugin"
|
|
|
|
]
|
|
|
|
}
|
|
},
|
|
},
|
|
|
|
"google": {
|
|
|
|
"credentials": "google.json",
|
|
|
|
"folder": "ID string"
|
|
|
|
},
|
|
|
|
"jobs": [
|
|
|
|
{
|
|
|
|
"type": "mergedoc",
|
|
|
|
"template": "template.docx",
|
|
|
|
"powerschool": {
|
|
"query": {
|
|
"query": {
|
|
"name": "org.psugIL.PowerSchool.Backup.studentsFull"
|
|
"name": "org.psugIL.PowerSchool.Backup.studentsFull",
|
|
|
|
"kwargs": {
|
|
|
|
"data": "{\"$q\": \"students.school_abbreviation==AGHS1\"}"
|
|
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
"google": {
|
|
"google": {
|
|
"credentials": "google.json",
|
|
|
|
"folder": "1dyUEebJaFnWa3Z4n0BFMVAXQ7mfUH11g",
|
|
|
|
"file": "students"
|
|
"file": "students"
|
|
},
|
|
},
|
|
"template": "template.docx",
|
|
"local": {
|
|
"output": "students.docx"
|
|
"file": "students.docx"
|
|
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
"type": "sheet",
|
|
"type": "sheet",
|
|
"powerschool": {
|
|
"powerschool": {
|
|
"api": {
|
|
|
|
"base_url": "powerschool.domain.com",
|
|
|
|
"credential_file": "ps.json"
|
|
|
|
},
|
|
|
|
"query": {
|
|
"query": {
|
|
"name": "org.psugIL.PowerSchool.Backup.studentsFull",
|
|
"name": "org.psugIL.PowerSchool.Backup.studentsFull",
|
|
"header": {
|
|
"kwargs": {
|
|
"first_name": "first",
|
|
"data": "{\"$q\": \"students.school_abbreviation==CHMS\"}"
|
|
"last_name": "last"
|
|
|
|
},
|
|
},
|
|
"split": [
|
|
"headers": [
|
|
"school_abbreviation",
|
|
"field1",
|
|
"grade_level"
|
|
"field2",
|
|
]
|
|
"field3"
|
|
|
|
],
|
|
|
|
"headers (renaming option)": [
|
|
|
|
{"field1": "new_field_1"},
|
|
|
|
{"field2": "new_field_2"},
|
|
|
|
{"field3": "new_field_3"}
|
|
|
|
],
|
|
|
|
"split": "school_name"
|
|
}
|
|
}
|
|
},
|
|
},
|
|
"google": {
|
|
"google": {
|
|
"credentials": "google.json",
|
|
|
|
"folder": "1dyUEebJaFnWa3Z4n0BFMVAXQ7mfUH11g",
|
|
|
|
"file": "studentsdata",
|
|
"file": "studentsdata",
|
|
"sheet": "foobar",
|
|
"sheet": "Sheet1",
|
|
"clear": true,
|
|
"clear": true,
|
|
"ref": "A1"
|
|
"ref": "A1"
|
|
},
|
|
},
|
|
"output": "studentsdata.xlsx"
|
|
"local": {
|
|
|
|
"file": "studentsdata.xlsx",
|
|
|
|
"sheet": "Sheet1",
|
|
|
|
"clear": true
|
|
|
|
}
|
|
}
|
|
}
|
|
]
|
|
]
|
|
|
|
}
|
|
|
|
|
|
``` |
|
``` |