Looking for assistance on using Set Text interaction to a Text Area with text values from multiple Global Variables. Specifically, I would like some global variable text to be bold and others not. Any help would be appreciated.
nm. found a workaround.
For others viewing this thread and looking for a solution, you can use the “rich text” option in the Set Text action. For example, if I want to make the second word of a string bold and blue, I would choose
SET TO “rich text”, click “Edit Text”, select the second word, then change the properties, then click OK.
To apply to a string variable–such as a global variable value, you’ll need an expression to parse that string. Axure supports most of the standard javascript string() functions, but does not support regular expressions (RegEx) nor arrays, so the code can sometimes get quite convoluted. You can search this forum for string manipulation topics, search internet for “javascript” and whatever you need, like “javascript find last word in a string.” and use the Axure reference for string functions and properties:
So, if i wanted to dynamically refer to a fragment of the text value of a widget, or a global variable, I’d need to use some string functions. Say I have a global variable named, “MyVar” and want the second word to appear bold and blue, but the value of MyVar can change (for simplicity’s sake assume it would always be a “sentence” with at least two words.) Here’s what this expression would look like:
rich text with variable.rp (47.2 KB)