Balsamiq Community Discussion

Idea: Text variables


I’ll tag this more as an idea than a request as I only have one example use case for now (other potential use cases I can think of would be better served by the requested “Find and Replace text” feature)

If you have a label or other text-based control on the page, the idea is that you could put %TITLE% and that would be replaced by the name of the mockup page. If the mockup is ever renamed, the object text is also immediately updated.

If anyone else has ideas for text variables (even custom user-created ones) feel free to share in here.

Balsamiq Query Language? Platform Extensibility?

Hey @Ryan,

Good news, this feature is already available! :slight_smile:

You can achieve this by typing {mockup-name} in your Label control, as shown below:


Well how about that. Learn something new every now and then. :wink:

Is {title} also an option just to save keystrokes?


Nope, {mockup-name} is the one we use for this. All text formatting options can be found here btw. Hope this helps! :slight_smile:


That was more a request than a question :slight_smile:

If there were a ‘Heading’ object to drag in from the top toolbar (similar to holding Y while dragging) it would be a good candidate to default to {mockup-name}. I’m only suggesting this since you already have the Text, Data Grid, and other controls which educate us on other formatting code.


This was an awesome thing to learn!

I’d piggy-back on this request by saying I’d love to have more variables. For example, sometimes we haven’t completely decided on something like a product name or the name of a field that appears in lots of places. I’d love to be able to enter that as a variable – something like %%product-name%% and then be able to do a global update to that variable. Ideally, we could define our own variables per project and then be able to enter their values in one place.


Yep I did have that in mind - only I figured the much more requested “Find & Replace Text” feature would probably work just as well and also retrospectively (how often do we forget to create symbols until -after- we’ve placed the same thing in 20 locations?) :slight_smile:

That said there’s probably a greater chance of me remembering to use variables early on compared to symbols.

On a tangent: maybe if I select multiple controls and go to paste them, the program could unobtrusively* ask if I want to make a symbol on the fly and ‘paste’ that instead?

  • i.e. in/just above the status bar - prompt can be ignored (not modal).


Yeah, I think Find & Replace will address this - but if you guys can think of a situation where it wouldn’t, I want to know. I think it’s a great idea and I don’t want to offer a solution that doesn’t address everything.

And that’s an interesting idea @Ryan. How would you go about asking the user if they wanted to paste it as a symbol?


Well, let’s say I start off with either a grouped or ungrouped selection of controls and I copy (Ctrl+C) them.

When I hit paste I get a prompt, but instead of having to click No every time I can just ignore it and it will go away as I continue to work.


I dig it, and the mockup is great.

I’ll bring it back to the dev team and see what they think


Here is a suggestion for implementing this without going outside the scope of the existing Balsamiq paradigm.

Implement it as a sort of Text Symbol, where we create a symbol called %%product-name%%, which must contain nothing more than a Label in the top/left corner. When we use text that is delimited with %% in any control, the Symbol library is checked, and the value of the one and only label is used to substitute the %% value in the rendered control.

From a code perspective I think this would be as easy to implement as the text markup functionality **, _, etc. and in fact could fit within that exact same code module.


Interesting one, @TonyG! We will probably take care of this by implementing the find/replace feature people have been requested for a while but that’s an interesting alternative, thanks for sharing it.