Forum Discussion

susanjohnson1's avatar
susanjohnson1
Community Member
4 years ago

Working with Text Variables

I am creating a course that three different agencies are taking.  Each one calls their prison population a different word - offender, inmate or juvenile which I have placed in another variable called population.  There are 3 times where "Inmate" needs to be capitalized.  I am able to make the whole word in caps, change the color, font and size but can't make the first letter capitalize.  What is the solution?  I'm sure it's something really easy that I'm missing.

  • Hi, Susan.

    Thank you for reaching out!

    While there is no trigger to capitalize the first letter of a variable or reference, you might be able to achieve that with Javascript. I'm looking forward to the suggestions you will receive from our talented community members, but in the meantime, I wanted to offer a "low-tech" alternative:

    • Add a second population variable with the same words as the first but in their capitalized form. 
      • Population = {inmate, offender, juvenile}
      • Population_StartSentence = {Inmate, Offender, Juvenile}
    • The triggers that adjust the first variable can be duplicated to adjust the second.
    • You would then reference the second variable (Population_StartSentence) the three times they have to be capitalized.

    Here's an example, which I am also attaching as a .story file:

    Screen Recording 2021-07-30 at 10.21.30 AM

    • susanjohnson1's avatar
      susanjohnson1
      Community Member

      I ended up adding a second variable for the capital. I was just thinking I was missing something simple. Guess not, thanks for your help!

      Susan Johnson
      Staff Development Specialist
      Office of Staff Development and Training

      Physical Address: 2211 Schieffelin Road | Apex, NC 27502
      Mailing Address: MSC-4213 | Raleigh, NC 27699-4213
      (o): 919-589-5423 | (f) 919-303-2922 | (e) susan.johnson@ncdps.gov

      https://www.ncdps.gov/adult-corrections/staff-development-training

      • BeccaLevan's avatar
        BeccaLevan
        Community Member

        Happy Maria was able to help you out, Susan, and thanks for stopping back by to share what the outcome was!

        I also wanted to pop in here to let you know that your email signature came through when you replied. You can remove that if needed; here's how ðŸ˜Š