August Development Update

We're thrilled to share some of the newest features and enhancements we've added to Text Blaze. We think you're going to love them as much as we do!

Text Blaze Upgrades

:tada: Announcing the {button} and {run} Commands

We're constantly in awe of the advanced logic many of you incorporate into your snippets. With commands like {if}, {repeat}, and the formula command, you can create incredibly dynamic snippets.

But we know there have been a few hurdles when you're trying to craft those really intricate interactions. So, we're super excited to announce two new commands and additional capabilities that will help you overcome these challenges and create even more powerful snippets that are also easier to build and maintain.

:new: {button} Command

The new {button} command lets you add a button to your snippet that triggers a formula when clicked.

Here’s a fun example—a simple counter that tracks how many times you've clicked the button:

Click count: {formtext: name=count; default=0}
{button: count = count + 1; label=Click me!}

Learn more about the {button} command

:new: {run} Command

The new {run} command executes a formula once, which is perfect for setting initial values. For instance, we could streamline our previous example, by using {run} to initialize the counter to 0:

{run: count = 0}
Click count: {=count}
{button: count = count + 1; label=Click me!}

Learn more about the {run} command

:new: Code blocks

To fully leverage the {button} and {run} commands, we're also introducing Code blocks. Code blocks allow you to run multi-line formulas, enabling variable definitions, conditional logic, and more. This not only adds power but also simplifies handling complex scenarios compared to single-line formulas.

Learn more about code blocks

Let's look at an example of how we can use {button} and {run} with Code blocks:

{run: tasks = ["Take out the garbage", "Wash the car"]}
Task List:
{repeat: for task in tasks}
{=task} {button: var index = location(tasks, task)
tasks = merge(slice(tasks, 1, index - 1), slice(tasks, index + 1))
; label=❌}{endrepeat}

New Task:
{formtext: name=task; default=} {button: if task = ""
notify("Task cannot be blank")
return
endif
tasks = merge(tasks, [task])
task = ""
; label=Add Task}

Note: {button}, {run} and Code blocks are currently in Beta and may change in the future.

Data Blaze Upgrades

:link: Limit Link Row Fields to Specific Views

Now, when setting up a link row field, you can restrict the field to only allow selections from a specific view in the target table.

image

:fire: Performance improvements

We have made a number of performance improvements to Data Blaze over the past month. Specifically:

  • Snapshotting and creating a space from a template will be much faster
  • Some date-time formula functions are much faster
  • Formulas that do not depend on other fields will be much faster in many cases
  • Row updates are faster
  • General speed ups across all processor-intensive operations

:clapper: Video of the Month

Learn how to add interactive buttons & multi-line formulas to your snippets in this video:

And remember... :hugs:

We're always here for you! If you ever need a helping hand, don't hesitate to drop a line in our Question and Answer community forums. And if there's something you'd love to see in Text Blaze or Data Blaze, we'd be absolutely thrilled to hear about it in the Features Ideas section.

5 Likes

I love this update and all these enhancements! Especially the button. I got to thinking though. A button that adds is great, but what if a user needs to subtract from their selection? Here's what I came up with.

Click count: {formtext: name=count; default=0}
{button: count = count + 1; label=+} {button: count = count - 1
; label=-}

1 Like

Nice thinking Brad :slight_smile:

Works great!

1 Like

I wonder - could there be a way that after clicking the Add Task button, focus is returned to the task form field so the user can quickly add another task? As it stands, one must either shift tab or click back on the field to do so. Would be great if this was a default behavior. It's not a huge deal on its own, but the positive impacts are tremendous when considering the compound affects of many users running the snippet countess times.

2 Likes

Interesting idea Brad. I wonder if there should be something like a focus function that allows you to focus a field.

Maybe you could pass it the name of a form variable and it focuses that first form field in the page that has that name.

For example, this would focus the form field that has name=task:

focus("task")

You could then include it in your button code to set the focus how you would like.

1 Like

YES! Bingo!

1 Like

Here's a Reset button to bring the field back:

Click count: {formtext: name=count; default=0}
{button: count = count + 1; label=+} {button: count = count - 1
; label=-} {button: count = 0; label=Reset}

2 Likes

Great! We'll get a focus() function added.

3 Likes

Trying to wrap my head around the new {run} command and how/why/when to use it. Based on the documentation, it seems to set the value of a field. How is that different than giving a field a "default" value? I feel like I want to somehow interact with the {run} command but I am missing something.

Yes, setting a value is similar to having a field with a default, however:

  1. {run} doesn't require creating a field
  2. {riun} can be put in a {formtoggle} or {if} so that the value is changed at some point other than snippet launch
  3. Most importantly, you can do a lot more than set a value in {run} (for instance, you could add a row to a space)
1 Like

@scott's list is great. To give a concrete example related to form default, using a {run} command, you set dynamic default values for form fields. For example:

Here, the default form field value gets set to the first entry from the table ("John"). It's not possible to do this without {run} command.

@Gaurang_Tandon That's where my disconnect is happening. Seems on the surface like its getting the name from the table then passing that name to the formtext field. Why not just get the value from the dbselect like we have been doing? What am I missing? Thank you for humoring me!

The use case I demonstrated was to be able to change a value after fetching it from dbselect. If you do not want to change the value and use it as is, then the regular dbselect is probably sufficient. This was requested in our community elsewhere (Formdate with a default date taken from another variable)

Ah ha! Thank you for that further explanation. I get it now.

2 Likes

Hey guys! I've been using TextBlaze for a long time now and I'm just getting in to DataBlaze. I'm more comfortable with data input into Google Sheets but I want that data to flow into my DataBlaze tables for use in snippets. I know there's an API and my question is, do you guys have some good resources for someone I could hire to set up this connection for me?

Hi @Brandon_Griffin - we're here to help. Please email us at support@blaze.today

Hello. Would someone be able to explain where I can find steps on how to do what the video above shows at 0:16?

Same! I am struggling to wrap my head around the new run commands. Buttons I got, but run.....nope!

1 Like