Logo Data Blaze

  • Docs
  • Community
  • Business
  • Documentation

    No search results

    Text Blaze

    Loading...

    Data Blaze

    Loading...

    Community Forums

    Loading...
  • Products
    • Text Blaze
      Snippets and templates
    • AI Blaze
      AI writing and editing
    • Data Blaze
      Tables and sheets
  • Resources
    • Documentation
    • Community forum
    • Gallery
    • Contact us
  • Pricing

Documentation

No search results

Text Blaze

Loading...

Data Blaze

Loading...

Community Forums

Loading...
Go to Dashboard ›
Docs
  • Guides
    • Getting Started
    • Using your Data Anywhere
    • Views Overview
    • Permissions and Sharing
    • Frequently Asked Questions
  • Reference
    • BSQL Reference

What's on this Page

  • Overview
  • 1. Adding row to a table
    • Getting started
    • Selecting which field values to add
    • Automatically adding fields
  • 2. Reading data from a table
    • Getting started
    • Selecting what data to read
    • Using the data in a snippet
    • Selecting which row to use
    • Dynamic conditions
    • Reading multiple rows
    • The Name setting
    • Additional settings
    • Advanced queries
  • 3. Updating a row
    • Selecting which field values to update
    • Automatically adding fields
  • 4. Deleting a row
  • [Advanced] Link to table fields
    • Reading a linked fields
    • Reading additional fields from the linked row
    • Adding or updating Link to table fields

Reading and updating your data from anywhere

Summary: Easily read and update your Data Blaze data from anywhere using Text Blaze snippets.

Quick Overview Video

Overview

Using Text Blaze snippets you can:

  • Collect data from anywhere by adding a row to a table.
  • Use your data anywhere by reading data from your tables.
  • Edit your data by updating a row in a table.
  • Remove data by deleting a row from a table.

If you're not familiar with Data Blaze, consider starting with the Quick Start guide.

In this guide, we will be using the following Data Blaze table.

1. Adding row to a table

Getting started

There are two potential ways to to add a row to a table from a snippet:

In Text BlazeIn Data Blaze
Add the Insert row into table command to your snippetClick on Add row to table

When adding the command to a snippet in Text Blaze, you'll need to specify the space and table.

That's it!

  • By default, when inserting the snippet, Text Blaze will create a new row in the table and populate it with the snippet's form fields' values.
  • Field name matching - Form fields that match a table field (column) name, will be added to that column.
  • If a form field name doesn't match any of the table's fields, a new table field will be created.

Try it out

  1. Create a snippet that adds a row to one of your tables.
  2. Add form fields and see how they are populated in the table when you insert the snippet.
  3. Try adding form fields that match table column names and some that don't.

Selecting which field values to add

You can chose which form values to insert by changing the Field values configuration from all form values to some form values and choosing which fields to insert.

Form fields that are in the snippet but don't correspond to table columns will be highlighted.

Automatically adding fields

By default, form fields that don't correspond to table columns will be added as new columns to the table. To prevent that, set the autoaddfields setting to No.

When the setting is No, form fields that don't correspond to table columns will not be written to the table.

2. Reading data from a table

Getting started

There are two ways to create a snippet that reads data from a table:

In Text BlazeIn Data Blaze
Add the Read from table command to your snippetClick on Use row in table

Selecting what data to read

When reading from a table the following needs to be specified:

  1. The Space to read from
  2. The table in the space to read from
  3. Fields to read
  4. Row(s) to read by specifying the condition(s) they must satisfy.

When using Use row in table from Data Blaze all the above are preset and can be modified by clicking on the command

Using the data in a snippet

The Read from table command will present the fields being read. Click on any field to add it to the snippet.

Selecting which row to use

When the menu setting is Yes (the default state), when inserting the snippet, a window will pop-up with a menu of all the rows that satisfy the conditions. Select one of the rows and the field values will be populated accordingly.

Dynamic conditions

Snippet form fields can be used in conditions to make them dynamic:

  1. Click on the Read from table command to show its settings.
  2. Add a condition or edit an existing condition.
  3. Click on the Form value icon and select the form field.

Try it out

  1. Create a snippet that reads data from one of your tables.
  2. Use the fields read from the table in the snippet.
  3. Try placing the Read from table command in a Note.
  4. Try changing the conditions and see how the snippet behavior changes.

Reading multiple rows

By default, only one row is read. You can read multiple rows at once by changing the Multiple setting to Yes. When ,multiple is set to Yes, you'll be able to select multiple rows in the table.

Field values will now be stored as a list. The can be accessed using their index, e.g., {=name[1]}. You can read more about working with lists here.

The Name setting

The setting is off by default. Giving the Read from table command a name, places the results in a namespace.

When reading one row, fields can be accessed through name["field name"]. For example, if Name is set to "person", age can be accessed as person["age"].

When reading multiple rows, the result will be a list of lists, each representing one row. Each row can be accessed through its index. For examples, person[1]["age"].

Additional settings

  1. The Order results by setting determines the order of rows returned and presented in the selection menu. Select a field to order by and whether to order ascending (small to large) or descending (large to small)

  2. Limit number of results to determines how many rows will be read and presented in the menu. Defaults to 200.

  3. Menu (set to Yes by default) determines if a menu to select a row will be shown in the pop-up. If set to No the first row(s) that satisfy the conditions will be automatically selected.

  4. Default sets the field value while data is being loaded. e.g., "name"="customer" will set the form field {=name} to customer until a row is selected.

  5. Isloading creates a field that will be set to yes while the data is loading and no when it's done loading. E.g., if the field name is set to "loading". the form field {=loading} will be set to yes while the data is loading and no when it's done loading:

  6. Haserror will be set to yes if there's an error loading data e.g. is the field name is set to "error", the value of the form field {=error} will be set to yes if there's an error and to no otherwise.

Advanced queries

Read from table supports bespoke queries using the BSQL querying language. See the BSQL reference for details.

3. Updating a row

To update a row, add the Update row command and:

  1. Define the table to update.
  2. Create one or more form fields that match table columns.
  3. Define a set of one or more conditions that define one (and only one) row.

If more than one row satisfy the conditions, the update won't work.

That's it!

  • When inserting the snippet the selected row will be updated with the selected form fields.
  • Field name matching - Table columns that match snippet form fields name, will be updated accordingly.
  • If a form field name doesn't match any of the table's fields, a new table field will be created.

Try it out

  1. Create a snippet that updates a row in one of your tables.
  2. Add form fields and see how they are populated in the table when you insert the snippet.
  3. Try adding form fields that match table column names and some that don't.

Selecting which field values to update

You can chose which form values to update by changing the Field values configuration from all form values to some form values and then selecting which fields to update.

Form fields that are in the snippet but don't corresponding to table columns will be highlighted

Automatically adding fields

By default, form fields that don't correspond to table columns will be added as new columns to the table. To prevent that, set the autoaddfields setting to No.

When the setting is No, form fields that don't correspond to table columns will not be added to the table.

4. Deleting a row

Deleting only requires setting the conditions that the deleted row must satisfy. You can only delete one row at a time - only one row should satisfy the conditions.

Be careful! Make sure that deleting rows programmatically is the right thing for you.

[Advanced] Link to table fields

Link to table fields are table fields that link to a row in a different table.

Reading a linked fields

If one of the fields in your table is a Link to table field, the value read is the same one shown in the table UI (the primary field of the linked row). E.g. the value of {=contacts} will be ACME Corp

You also have the option to read the row id. This will return a list of the linked row ids (list because there can be more than one).

Row ids are unique identifiers of the table rows. They are different from the row number in the UI, which can change based on sorting or filtering. For example, {=`contacts->id`} may be equal to ["3XKJDqJ9v76ylfWEOayzNZ", "1utolLwgjtcD7G4pdi5376"]

Reading additional fields from the linked row

If you'd like to read additional fields from the linked table, you can do that it two ways:

  1. [Recommended] Add these fields to the table as Lookup fields and read them as well.
  2. [Advanced] Read the field's row id and use it in a separate Read from table command as the condition. See the BSQL reference for details.

Adding or updating Link to table fields

To add or update the value of a Link to table field, the snippet form field needs to contain a list of the linked row ID(s). E.g., {contacts=["3XKJDqJ9v76ylfWEOayzNZ", "1utolLwgjtcD7G4pdi5376"]}

About

Plans and Pricing
Sharing Snippets
Text Blaze for Business
Forms
Autopilot
Dynamic Commands
Command Packs
Text Blaze for Windows
Text Blaze for macOS

Support

Get Started with Text Blaze
Contact Us
Documentation
Community Forum
Blog
Gallery
Engineering Blog

Solution for

Business
Customer Support
Recruiters
Education
Healthcare
Sales
Property Managers
AI

Other

Privacy Policy
Terms of Service
Open Source Licenses
Affiliate
© Blaze Today Inc