Using TextBlaze Form to Query DataBlaze Tables

So the way that I currently use TextBlaze is for information formatting when looking up parts for a customers machine.

What I'm interested in doing, is I've uploaded all of the database information I have for kits that are offered to see if I can have TextBlaze pull the kit number based on the SKU numbers in the far right, and populating the "Kit" section with the kit number.

Here's what the form looks like:

And then my DataBlaze tables look like this:

I just wasn't sure if TextBlaze has the capability to query the database from text imputs.

Hi @Matthew_Valentia Welcome to the forum! :slight_smile:

If we assume the SKU is "15KIT_MK1001082", then the corresponding value in the Data Blaze table is "15MIS_C-ARF-0002=1,15MIS_C-CAM-0002=1,15MIS_C-CYL-0011=1,15MIS_C-FLF-0001=1,15MIS_C-OLF-0001=1,15MIS_C-SPK-0008=1,15MIS_K-GSK-0017=1,15MIS_K-PST-0016=1". Now, which specific parts from this value would you like to extract into your snippet?

So what I'm looking for is the reverse.

I want to look for a kit number based on the SKUs that are filled out in the form.

So in this example:

It would correlate to this kit number in the DataBlaze:
Screenshot 2025-06-04 082214

And then it would populate the kit field with the proper kit number.

If need be, I could add a quantity drop down at the end to add the "=x" at the end, if it needs to be that specific.

Here's a general way you can approach this:

{formtext: name=Filter text}
{if: len(`Filter text`) > 0}{dbselect: SELECT name, Count FROM Table1 WHERE contains(Name, `@Filter text`) LIMIT 1000; space=id; name=selections; multiple=yes}
Your selections are:
{repeat: for selection in selections}
{=selection["name"]} {=selection.count}
{endrepeat}
{else}
Start typing to make a selection
{endif}

The Filter text field in my snippet would correspond to the SKU field in your snippet. And then you would use the dbselect command to get the kit number value. You would use the contains() function to find the matching rows.

Let us know if it works for you.