Script Library

These scripts allow for easy upload of data in Excel worksheets – as well as select ways to bulk edit your races. It is important that you have a clear understanding of how a database operates before using the script library.  Data must be clear of any formatting and headings must be entered exactly as indicated.  The file type must be exactly as requested.  Please review the description, options, and data requirements before creating/editing a spreadsheet.

Import candidate images from spreadsheet: Creates and updates candidate images in your guide using data from a spreadsheet. You can either copy and paste the contents of the spreadsheet or export the spreadsheet as tab- or comma-delimited text and upload that file.  The first row of the spreadsheet contains the column names and should include the following in any order: fullname, imageurl.  This script times out after 60 seconds. If it times out before completing a particular spreadsheet, try importing a smaller subset of the rows in the spreadsheet.

Import GIS district sets:  Imports one or more GIS district set from a file created with the GIS district set export script.

Import or update candidates from a spreadsheet:  Creates and updates candidates in your guide using data from a spreadsheet. You can either copy and paste the contents of the spreadsheet or export the spreadsheet as tab- or comma-delimited text and upload that file.  The first row of the spreadsheet contains the column names and should include the following in any order: fullname, lastname, race, userdata, party, occupation, imageurl, contactname, contactemail. Any other columns will be intepreted as bio fields. The fullname, lastname and races columns are required; all other columns are optional. If you include many candidate image URLs, this script may reach its maximum running time of 10 seconds before completing. In this case, remove the imageurl column from your data for this script and later use the “Import candidate images,” which has a 60 second timeout, to import the candidate images.

Import or update races from a spreadsheet: Creates and updates races in your guide using data from a spreadsheet. You can either copy and paste the contents of the spreadsheet or export the spreadsheet as tab- or comma-delimited text and upload that file. The first row of the spreadsheet contains the column names and should include the following in any order: name, description, referendum {true, false}, category, bioset, questionset, districttype, districtid, numselections, userdata. The name column is required; all other columns are optional.

Import question and answers from a spreadsheet:  Creates questions and candidate answers in your guide using data from a spreadsheet. This script either overwrites existing questions or add new questions but does not update answers to existing questions. You can either copy and paste the contents of the spreadsheet or export the spreadsheet as tab- or comma-delimited text and upload that file. The first row of the spreadsheet contains the column names and should include the following in any order: question, questiontype (optional), answer (“official answer”, optional). There should also be a column for each candidate for which to load answers. The name of the column must be the exact name of the candidate. When you include a candidate you must include all the candidates from the same race. As a convenience you may define multiple header rows in the same spreadsheet. Any row whose value for the question column is equal to ‘question’ will be treated as a header row defining column names.

Set all referendum choice names:  Sets the names of all yea and nay choices in all referendums in the guide.

Set race/office district based on numerical name:  Determines and sets the district of a race or office based on its name. Often you have a race/office for each district of a certain type in a state. For example, you may have a race for every US Congressional district. Name each race according to the district index, for example ‘US Representative, District 1.’ Then use this script to automatically set the district of each race according to the district index contained in the race name.

 

The following scripts are for exporting data from your guide for future use:

Export GIS district sets:  Export one or more GIS district sets into a single file. The downloaded file can then be used with the GIS district import script to copy the selected district sets to another guide.

Export questions and answers:  Export race questions and candidate answers in a tab-delimited format. Choose which races to export and whether to create sections for each race.

Back to Help Topics

MENU