Creating a Unique Record in Data Blaze

Hello All; new user here and enjoying the product so far. I plan to create a form and add the data to a Data Blaze table.

I come from a database world where unique records are necessary, but I don't see how this can be done in DBlaze - unless of course I missed something.

Has anyone solved this issue? I'm learning the forms part but in a simple test it adds a duplicate record.

Thanks in advance
Terry

HI @Fern_List ,
Welcome to Text Blaze community.
When you submit a form with same data, what do you expect to happen? Do you want to not add the new duplicated record?
And is your duplciation logic based on all columns or some columns or only one column?

If you using a snippet you can use this

{formtext: name=newname; default=John}
{dbselect: SELECT name FROM Table1 WHERE Name=@newname; space=id; multiple=yes; menu=no; isloading=loading}
{if: not loading and count(name) = 0}
{dbinsert: INSERT INTO test SET Name=@newname; space=id; autoaddfields=no}
{endif}

Thanks Vinod for the example; I finally figured how to paste the snippet and modify it for my use case.

You guys are awesome!

1 Like