Best Practices

 View Only

Ian's Insights Ep2: String Concatenation - the unsung hero

  • 1.  Ian's Insights Ep2: String Concatenation - the unsung hero

    Posted 12-16-2021 10:01
    Edited by Pat Cooney 02-06-2024 11:40

    One of the question types that is often overlooked is the String Concatenation question. There are a few different reasons why you might need to use this question type, some obvious, some not so much.

    What is the word for tying two cats together?
    String ConCATenate

     

    Okay - enough with the bad jokes… String Concatenations are generally used to combine 2 or more strings together, best example is if you are collecting a first name and a last name, you can use a string concatenation to give yourself a full name in the same question. In this article, I am going to go over a few different ways it can be used.

    Example 1: First Name + Last name = Full Name

    Let’s start with the simplest and maybe most obvious example first, creating a full name with a first and last. This one will require a question that captures the first name and a separate question that captures the last name. Using the string concatenation question, we can get the full name (NOTE: the text row in the screenshot below contains only a space to separate the first and last.

    Form Builder:

    In the app:

     NOTE: You can now use this Full Name question in your DREL references to make it a little easier on yourself down the road so you might want to hide the Full Name question on the device to keep things tidy.

    Example 2: Showing the answer to a question later in the form

    Let us say at the top of your form you are capturing the users name while they are filling out the form, then, later in the form, you also have a signature field where you are prompting again for the name. Instead of asking again for the user's name a second time, use a string concatenation question to display the same name that they input at the top of the form.

    This question type does not always need to have more than one question in it, just a single question can be configured solely to display the same value as the question that it is referencing.

    Form Builder:



    In the app:

    This will push the Name found in the General Information section, down to the Name in the Sign off section to save your users a few seconds of typing in their name more than once, or even selecting from a dropdown.

     

    Example 3: Display one answer or the other

     

    Sometimes, when building out a form, you want to give your users the option on how they input their answers. Something like "Choose existing customer or create new" is an option that is seen in many forms but what if you need to send this data somewhere or are using DREL (Data Record Expression Language) to reference this information. Using a string concatenation question, you can combine the two (or more) questions so that you can just reference a single question instead of using conditional logic to do it.

    I’m still u
    sing conditional logic to either show the dropdown or the text box, but I now have the possibility of the Customer Name coming from two separate questions:
     

    Form Builder:

    Including both questions in a string concatenation will give you a single question to reference with the customer's name coming from one of those two questions:

    In the app:


    Example 4: Showing a question that is hidden on device in the Summary Table for a repeat section

     

    Sometimes there is a requirement to show a hidden question in the summary table for a repeat section. An example of this is would be when a question is hidden so that the repeat section is a little cleaner and not cluttered with questions that do not need answering, but you still want to see this information in the summary table.

    To achieve this I am
    creating a section that starts as collapsed at the bottom of the repeat with a string concatenation question referencing the hidden question, and then using the string concatenation question in the summary table.

    Something Hidden has a default value set, but is set to not display on the device and the "Hidden Section" is set to start as Collapsed so the users do not see the questions in the section unless its expanded.

     

    In the app, when inside the repeat section you will not see the question being displayed and our concatenation question is in the Hidden Section that we are starting in a collapsed state:

    But in the Summary Table you can see that only the String Concatenation question is visible in the table:

     

    As you can see there are a ton of different ways that this question can be used... Are you using String Concatenation questions anywhere in your forms? Share with us what you are using them for!


    #TechTalkImplementation
    ------------------------------
    Ian Chamberlain
    Implementation Specialist
    ProntoForms
    ------------------------------



Reminder: Content posted to our Community is public content.  Please be careful not to post Intellectual Property that you do not have permission to share.  For more information please refer to our Terms Of Use