Can I have the result of an if/elseif command become the name of a form field?

I work at a business that does a ton of scheduling. One of the email snippets I use all the time tells people the name of the class they're in, and mentions the weekday and time the class runs (start and end time).

Right now, I have it set up where I select all of those options in a dropdown list. Easy enough, but I want to streamline it even more where if I just choose the name of the class, the days and times are automatically chosen for me because those won't ever change.

Later on in the email I summarize the information, saying "we can't wait to see you for CLASSNAME on WEEKDAYS at TIME". With my current setup, I can just use a formula that recalls the name of each of those dropdown menu fields. However, with what I'm working on now, as far as I can tell the text result of an if/elseif command can't become a named form, and therefore cannot be recalled in the same way. Does anyone have any tips? Is this even possible?

I can share my current snippets as an example if someone can show me how that's done on this forum. Thanks!

Hi Elliot, welcome to the forum!

I have a created a snippet that does what you describe and put it below. It uses if statements and assigns variables with the if statements with the syntax {variable="text"}.

Let me know if this works and if you have any questions!

Hi {formtext: name=Name},

You are signed up for {formmenu: default=Class 1; Class A; Class 2; Class B; name=Class}
{note: trim=yes}{if: Class="Class 1"}
{weekday="Monday & Wednesday"}
{time="6:00 PM - 7:00 PM"}
{elseif: Class="Class A"}
{weekday="Tuesday & Thursday"}
{time="5:30 PM - 6:30 PM"}
{elseif: Class="Class 2"}
{weekday="Friday"}
{time="7:00 AM - 8:00 AM"}
{else}
{weekday="TBD"}
{time="TBD"}
{endif}{endnote: trim=yes}
We can’t wait to see you for {=Class} on {=weekday} at {=time}!

Best regards,
Alexander

Hi Alexander,

Thank you so much for this! This is definitely something I can take and edit for myself. I do have some questions though, because I'd like to learn how to do this myself instead of just having helpful people like you create the snippets for me.

As an example, the if/elseif function doesn't show up as "insertable" when you're browsing the sidebar in the Text Blaze dashboard. if/else is there, but not if/elseif. How would I go about adding that into my snippets without having to go to the Text Blaze document discussing {if} statements and copying the example snippet every time?

Also, is there a way to manually type in these "commands"? I keep seeing commands surrounded by {these} and I figured maybe that'd be a way to type them in but it wasn't working for me, maybe I was doing it wrong. Thanks in advance!

Hi Elliot,

Glad the snippet meets your needs! You are correct that elseif doesn't show up when using the command within the dashboard, I'll talk to the team about adding that option and you can also post it in the feature requests category in the community.

All Text Blaze commands are surrounded by {} as you noticed. For elseif, it looks like this: {elseif: variable = "text"}

You can double click on any of the command bubbles in Text Blaze to see how they are written in text. I also recommend taking advantage of AI write within the dashboard since it knows our syntax and can help you create snippets based on an idea.

Best regards,
Alexander