Recent Updates Page 2 Toggle Comment Threads | Keyboard Shortcuts

  • Belen 9:52 am on March 7, 2023 Permalink  

    Feature update – *searchable answers, store data in a custom column of the CSV file 

    Here’s what’s new:

    Searchable answers


    Often we want to ask users a question with a large set of predefined answers (e.g. the country where they are in). A multiple-choice question will do the job but will be awkward to use because finding the desired answer may require a lot of scrolling.

    In such cases, *searchable questions are a more user-friendly solution. Here, you still have a list of valid answers, but the user initially sees a box where they can start typing their answer. As they do, a drop-down list appears with matches for what the user is entering.



    This is the syntax you would use:

    *question: Please, select the country where you were born:
    	*searchable
    	Andorra
    	Angola
    	Antigua and Barbuda
    	Argentina
    	Armenia
    	...
    
    You will find some programs in the program library that use this functionality:
    • country of birth (code, preview)
    • US state of birth (code, preview): This program asks in what state or territory of the US the user was born. If they were not born in the US, then the program asks for their country of birth, but you can deactivate this follow-up question if you wish.
    • country question (code, preview): By default, this program asks what country the user is in, but you can set the variable `in_countryQuestion` to whatever question you need to ask that requires a country for an answer. For example, “What country has the best cuisine in the world?”
    • US state question (code, preview): Use this program to ask in what state or territory the user is. There is a follow-up question if the user says they are not in the US to ask the country they are in, which can optionally be deactivated. Like in the country question, here you can also change the text of the question.

    Storing data in a custom column of the CSV file that stores all user responses

    Any variable in your program will show as a column in the CSV file when you download the generated data. The name of the column will be the variable name. But sometimes it’s useful to store data in a column whose name is determined while the program is running. The new `data::store` feature lets you do exactly this by calling:
    `>> data::store(columnName, value)`

    Here is how you would use it:

    >> columnToPutData = "my new column"
    >> myValue = 24
    
    >> data::store(columnToPutData, myValue)


    As an example, below is the code of a program where you ask users to enter the last three movies they watched and save it into a variable called movies:

    *question: Please, type in the last three movies you watched:
    	*save: movies
    	*multiple
    
    
    Then you ask the users to rate each movie that they entered:
    *for: movie in movies
    	*question: How many stars would you give the movie {movie}?
    		*answers: [5,4,3,2,1]
    		*save: answer
    
    
    When you download the CSV file, you will have a column with the name “How many stars would you give the movie {movie}?” and for each run, you will have all the ratings that the user provided separated by a pipe(|). The variable `answer` will also be in the CSV file, and it will only have the last rating the user provided (since its value gets overwritten in every iteration).

    Ideally, you should have a separate column for each movie, with its corresponding rating if a particular user selected that movie. You can accomplish this using >>data::store(columnName, value):
    *for: movie in movies
    	*question: How many stars would you give the movie {movie}?
    		*answers: [5,4,3,2,1]
    		*save: answer
    	>>data::store(movie, answer)
    
    
    This way, if the value of movies is [“Titanic”, “Easy Rider”, “Dune”], there will be three columns on the CSV file with the names “Titanic”, “Easy Rider” and “Dune”, with the ratings provided by the users who watched either of those movies.
     
     
  • Belen 3:34 am on August 26, 2022 Permalink  

    Feature update – Questions with *other answers, give a hint with *placeholder, SSO 

    Here’s what’s new:

    Allowing other answers to multiple-choice and checkbox questions


    The attribute *other allows users to type in an answer to a multiple-choice or checkbox question. For example: 
    *question: What is your favorite ice cream flavor?
        *other
        Strawberry
        Rocky road
        Cookies and cream
        *save: favoriteIceCream
    
     



    Here, the variable favoriteIceCream will take the value StrawberryRocky road, Cookies and Cream, or the flavor they type in the box.

    Likewise, *other can be used in checkbox questions:

    *question: What toppings do you want on your pizza?
        Mushrooms
        Pineapple
        Ham
        Onion
        Italian sausage
        *type: checkbox
        *other
        *save: pizzaToppings



    When you allow for *other answers to a multiple-choice question, multiple additional answers are allowed. As soon as the user starts typing in the “other” box, another one will appear right below. Also, you will notice that the answers the user types in are selected by default.
     

    Using *placeholder to give a hint


    The *placeholder attribute is used to display a word or short phrase inside an input box describing the expected value of the field (e.g., a sample value or a short description of the expected format). You can use it in all question types that involve typing (e.g., text and paragraph). 

    *question: Give your intro:
        *type: paragraph
        *placeholder: Write here something about yourself...
    
    
    As soon as the user starts typing in the text box, the *placeholder text will disappear, so make sure that any complex instructions that are hard to memorize are displayed elsewhere (for example, using *tip).
     

    Single Sign-On (SSO)


    SSO allows program users to log in using their ID on another system, instead of having to create a bespoke GuidedTrack account and remember another set of credentials.

    Go to Settings > Login and follow the instructions on the screen to configure external identity providers. Keep in mind that you will need to access your provider’s admin console to do so.


     
     
  • Belen 4:24 am on February 16, 2022 Permalink  

    A *service case study: Generating a PDF in your program with APITemplate.io 

    Users have reached out to us asking if it is possible to dynamically generate a customized PDF that they can share with the participants of their survey. While GuidedTrack does not have that functionality, you can easily integrate with external services via REST API to do so.

    There are a number of solutions available, such as APITemplate.io, PDF Generator API, and PDF Monkey. All three of them are paid services, although APITemplate.io and PDF Monkey both offer a free plan for that allows you to generate a small number of PDFs a month for free.

    On this case study we will show you how to configure and write a program that generates a PDF using APITemplate.io.

    Let’s say you have written the following program for a quick happiness assessment:

    -- Questionnaire
    *question: Enter your name
    	*save: name
    	
    *question: How happy are you today?
    	*type: slider
    	*answers: [1,2,3,4,5]
    	*before: Not happy
    	*after: Super happy
    	*save: happinessScore
    	
    *if: happinessScore >= 3
    	>>happinessEval = "you are quite happy"
    	>>motivationalPhrase = "Keep it up!"
    	
    *if: happinessScore < 3
    	>>happinessEval = "you are not very happy"
    	>>motivationalPhrase = "Cheer up!"
    

    As you can see, four variables are generated: name, happinessScore, happinessEval and motivationalPhrase. We want to use the value of these variables to fill in a pdf that the users of our assessment can download. Here is how you would do it!

    Generating the PDF template

    • Create an account and log into APITemplate.io
    • Go to Manage templates and select New PDF Template to go to the template editor
    • Choose to use the Visual Editor to create your template if the design of your pdf is simple or you don’t know how to write html code. For a more complex layout, create an HTML template
    • Give your template a name, choose the sample that resembles most what you need and click on create
    • At this point, you will automatically return to your templates dashboard and you will find there the template you just created:

    Click on Launch WYSIWYG Editor to edit the template. Use it as a word processor, and surround with double curly brackets the name of any variable that will be received from your program. For example, our template below has four variables: name, happinessScore, happinessEval and motivationalPhrase:

    Go to the JSON tab to generate a JSON object with some test values so that you can see the template in action. This is the JSON object we have created for our example:

    {
        "name": "Willie",
      	"happinessScore": "3",
      	"happinessEval" : "you are quite happy",
       	"motivationalPhrase" : "Keep it up"
     }

    And this is the PDF it generates:

    Now that you have a template ready, you can do the integration with GuidedTrack! Before you leave the APITemplate.io site, there are two things that you will need. One is your template’s id, which can be found in the tab Manage templates next to the template’s name. Then go to the API integration tab to locate your API key.

    Configuring the service

    Go to the settings>services tab in your program and create a new service with the following data:

    Name:

    URL:

    Click on + Add header and fill it up like this (using your own API key):

    Key:

    Value:

    X-API-KEY

    801aNjA5NjozMTE0Sk9YaG9JH3BYanIwVkVzTGa

    Writing your program

    Here is the code to add to the program, after the variables have been generated, to connect with APITemplate.io:

    >>template_id = "d5e77b2b2a3b8d2c"
    
    -- Create pdf
    *service: pdfGenerator
    	*path: /create-pdf?template_id={template_id}
    	*method: POST
    	*send: {"name" -> name,"happinessScore" -> happinessScore, "happinessEval" -> happinessEval, "motivationalPhrase" -> motivationalPhrase}
    	*success
    		>> pdfUrl = it["download_url"]
    		>> transactionRef = it["transaction_ref"]
    		>> status = it["status"]
    	*error
    		Sorry, we encountered an error while generating your pdf: {it}
    		*set: pdfGenError
    
    -- Display pdf URL
    *if: not pdfGenError
    	You can download your pdf here: {pdfUrl}

    First, we have created a variable named template_id that we initialize with id of the template we created in APITemplate.io.

    Then we call the pdfGenerator service, sending an association with the data to fill in the template.

    If all goes well, the object it will return the URL that the pdf can be downloaded from. Otherwise, it will contain an error message.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel