Importing File Attribute Templates
As an alternative to using the Portal File Attribute Template builder to create Attributes Templates, Project Administrators can import the Template configuration as a JSON.
Instructions
On your local computer, create and save a JSON containing your annotations. See Formatting Guideline for JSON File Attribute Templates, below.
Launch your Project and navigate to the Project Settings.
Select the File Attributes tab and click Import Attribute Template.
Enter an Attribute Template Name, select the JSON you created for upload, enter an attribute Description. Click Ok.
Your new File Attribute Template is created with visibility Hidden. The File Attribute Template will not be visible to other Project Members. To update this, click the edit icon and click the visibility bar. The slider should move from Hidden to Visible. Select the checkmark and click Make Visible. Visibility will now be turned on and Project Members will be able to see the Template and annotate files with these Attributes (see Adding and Modifying File Attributes for more information on how to annotate files).
If the uploaded JSON contains formatting errors, a parse error message will be returned. Please review the Formatting Guideline for JSON File Attribute Templates section below, then check your uploaded file and try again after adapting it accordingly.
Formatting Guideline for JSON File Attribute Templates
JSON is built around two structures:
Objects
Key-value pairs
Surrounded by curly brackets (
{}
)
Arrays
Lists of items
Surrounded by square brackets (
[]
)
Parameters for File Attributes JSON Templates are as follows:
Name: the Attribute name (letters or numbers, no spaces).
Type: the type of information to be collected (
text
,single choice
,multiple choice
,date only
,date and time
)Value: if type is Single or Multiple Choice, a list of the accepted values, separated by commas.
Optional: (default=
true
). Set tofalse
if the Attribute should be mandatory on collection.
The following example depicts a File Attribute Template created in the Project Settings menu and the corresponding JSON format. You can use this example as a guideline to create your own JSON.
Template created in the Project Settings menu:
Corresponding JSON format:
{"attributes":[{"name":"Group","options":["A","B","C","D"],"type":"multiple_select","optional":true},{"name":"FaveMeal","options":["breakfast","dinner","lunch"],"type":"multiple_select","optional":false},{"name":"FaveFruit","options":["apples","bananas","oranges","strawberries"],"type":"single_select","optional":true},{"name":"FaveSnack","type":"text","optional":true},{"name":"DateofCompletion","type":"date","optional":true},{"name":"DateTimeOfDinner","type":"datetime","optional":true}]}