Bulk Creating a Script in Switchboard

Updated by Alexis Salcedo

Switchboard now has the functionality to build and create scripts for your volunteers and staff to use when replying to folks in the inbox. While you can create your scripts one step at a time, some people like to write their scripts outside of Switchboard, get edits from their team, and then bulk create the script all at one time in Switchboard. This is easy to do, and should save you time! This document will walk you through the basics of bulk creating a script, and some things to keep in mind in order to make the process as smooth as possible.

What format does Switchboard need my script in?

Bulk creating scripts can be in many different formats. With Switchboard, we thought about what would be the easiest to learn, replicate, teach your teams, and allow us to identify errors. We landed on using YAML. Even if you are not familiar with writing code, this language is really easy to use, and as simple as writing out a google doc in a specific format. Here is a YAML template for you to follow: Sample Formatted Script

If you have not already, download a free script text editor either Sublime text or any text editor will do! This will make it easier to write out your script. Google did just come out with a google doc code block, so if it's easier for you to QA with your team in a google doc, you can use this template to write out your code!

NOTE: With the google doc, the language is "unset" so the spacing is not specifically accurate for YAML. Please makes sure your spacing is the same as the template in order for it to load into Switchboard properly.
Let's break down the elements we need in our script

name: this is required, and just names the script on upload

description: this is optional, if you wanted to add a note for later

display_question: This is specific for the volunteer to understand the core question that is being asked. It will display over the options they can choose from like this:

inbox_responses: (this tells us when the response options start)

- answer: This will display in the header of the first possible answer a volunteer can choose

  content: "This is what will populate in the text to send to the recipient"

  label: "label 1" - you can add an existing switchboard label here that allows you to track data for this specific response. Each response can have 1 associated Switchboard label so you can track data for you to use in NGPVAN or help you build audiences later! Volunteers will not see this label, but admin can use these to track data within a script.

display_question: Another display question for the next set of answers!

  branches:

- answer: This the first branch of this specific segment, if they answer the above response, it will lead them down this branch, and the format stays consistent!

   content: "First branched content for this answer"

label: "label for this answer"

YAML is really specific with it's formatting and spacing, so make sure to follow either the google doc template or our YAML template!
 I don't know what's wrong with my script

No worries, when you upload the script our system should tell you exactly why your script is failing. Additionally, our team would be happy to walk through your script with you and troubleshoot issues. Feel free to reach out to support@oneswitchboard.com for help!


How did we do?