Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
GrantBooth
Creator
Creator

Conditional Text

I'm trying to create a text box that changes based on the users selection, so if Month = '03', it returns the following

 

"Did you ever hear the tragedy of Darth Plagueis The Wise? I thought not. It’s not a story the Jedi would tell you. It’s a Sith legend. Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could use the Force to influence the midichlorians to create life… He had such a knowledge of the dark side that he could even keep the ones he cared about from dying. The dark side of the Force is a pathway to many abilities some consider to be unnatural. He became so powerful… the only thing he was afraid of was losing his power, which eventually, of course, he did. Unfortunately, he taught his apprentice everything he knew, then his apprentice killed him in his sleep. Ironic. He could save others from death, but not himself."

I feel like I'm missing something, I've tried

if(Month = '03',


'<p>&quot;Did you ever hear the tragedy of Darth Plagueis The Wise? I thought not. It&rsquo;s not a story the Jedi would tell you. It&rsquo;s a Sith legend. Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could use the Force to influence the midichlorians to create life&#8230; He had such a knowledge of the dark side that he could even keep the ones he cared about from dying. The dark side of the Force is a pathway to many abilities some consider to be unnatural. He became so powerful&#8230; the only thing he was afraid of was losing his power, which eventually, of course, he did. Unfortunately, he taught his apprentice everything he knew, then his apprentice killed him in his sleep. Ironic. He could save others from death, but not himself.</p>'

, 'a')

 

Obviously the formatting isn't working properly, what is the best way to handle this?

5 Replies
Digvijay_Singh

Not sure if I understand the problem, are you saying you receive special character like <p>&quot; in the textbox output when you select month 03? Is that the problem?

GrantBooth
Creator
Creator
Author

Yeah, I'm able to have text show if the condition is met, what I'm hoping for is a little help with the formatting

Digvijay_Singh

For single quote and double quote chr(39) and chr(34) can be used, but strangely I don't see these characters in the output if I try this in the text box, looks like your output comes from some web application, not sure if I am missing something - 

if(1,
chr(34)&'Did you ever hear the tragedy of Darth Plagueis The Wise? I thought not. It’s not a story the Jedi would tell you.It’s a Sith legend. Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could use the Force to influence the midichlorians to create life… He had such a knowledge of the dark side that he could even keep the ones he cared about from dying. The dark side of the Force is a pathway to many abilities some consider to be unnatural. He became so powerful… the only thing he was afraid of was losing his power, which eventually, of course, he did. Unfortunately, he taught his apprentice everything he knew, then his apprentice killed him in his sleep. Ironic. He could save others from death, but not himself.'&chr(34))

MayilVahanan

HI 

Try like below

if(Month = '03',


'"Did you ever hear the tragedy of Darth Plagueis The Wise? I thought not. It''s not a story the Jedi would tell you. It''s a Sith legend. Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could use the Force to influence the midichlorians to create life... He had such a knowledge of the dark side that he could even keep the ones he cared about from dying. The dark side of the Force is a pathway to many abilities some consider to be unnatural. He became so powerful... the only thing he was afraid of was losing his power, which eventually, of course, he did. Unfortunately, he taught his apprentice everything he knew, then his apprentice killed him in his sleep. Ironic. He could save others from death, but not himself"'

, 'a')

 

O/P:

MayilVahanan_0-1633490998759.png

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
GrantBooth
Creator
Creator
Author

Thanks for that. I suppose more specifically I'm trying to work out how to make the output be formatted text. So I've worked out how to do a new paragraph, chr(13). So it so far is something like

if(Month = '03',


'Did you ever hear the tragedy of Darth Plagueis The Wise? I thought not. Its not a story the Jedi would tell you.'
&chr(13)&chr(13)&
'Its a Sith legend. Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could use the Force to influence the midichlorians to create life'&chr(13)&chr(13)&
'He had such a knowledge of the dark side that he could even keep the ones he cared about from dying. The dark side of the Force is a pathway to many abilities some consider to be unnatural.'&chr(13)&chr(13)&
'He became so powerful; the only thing he was afraid of was losing his power, which eventually, of course, he did.'&chr(13)&chr(13)&
'Unfortunately, he taught his apprentice everything he knew, then his apprentice killed him in his sleep. Ironic. He could save others from death, but not himself.')

The next thing I'm trying to do is change some of the text to bold, so let's say I would like dark side to be bold, how would I go about doing that?