# Identifier Generator & Insertion

**URL:** <https://community.blaze.today/t/identifier-generator-insertion/23005>\
**Category:** Feature Ideas\
**Created:** [September 26, 2022, 8:54pm UTC](https://community.blaze.today/t/identifier-generator-insertion/23005 "2022-09-26T20:54:49Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Gaurang\_Tandon](https://community.blaze.today/user_avatar/community.blaze.today/gaurang_tandon/32/3796_2.png) [@Gaurang\_Tandon](https://community.blaze.today/u/Gaurang_Tandon)\
**Post date:** [September 29, 2022, 10:25am UTC](https://community.blaze.today/t/identifier-generator-insertion/23005/5 "2022-09-29T10:25:48Z")

</div>

[The latest beta feature is out](https://community.blaze.today/t/request-for-feedback-data-blaze-beta/22784). In simple terms, it is a spreadsheet connected to your snippet. Let's see how to solve your use case with that

**Table**

Visit [spaces](https://dashboard.blaze.today/spaces) link, create a space and then create a table inside it with name (`IdentifierGeneration`):

 ![image](https://community.blaze.today/uploads/default/original/2X/f/f0ddd025939d474cdaa8c79feea3b216e7dd1c6e.png)

**Snippet**

The snippet is below. For it to work, first you need to set the value of `space=CHANGE_ME` to the space ID, which you can get from the URL `https://dashboard.blaze.today/space/SPACE_ID/table/TABLE_ID/`

```auto
{note}
{dbselect: SELECT Prefix, Count FROM IdentifierGeneration ORDER BY Count DESC; space=CHANGE_ME; menu=yes}{if: prefix == "CREATE NEW"}{use_count=1}Type new prefix to add: {formtext: name=use_prefix}{else}{use_count=count+1}{use_prefix=prefix}{endif}
Visual padding: {formtext: name=padding_count}{padded_use_count=base(use_count, 10, padding_count)}
{endnote: trim=yes}
{=use_prefix}{=padded_use_count}
{if: prefix == "CREATE NEW"; trim=yes}{dbinsert: INSERT INTO IdentifierGeneration SET Prefix=@use_prefix, Count=@use_count; space=CHANGE_ME; autoaddfields=no}{else}{dbupdate: UPDATE IdentifierGeneration SET Count=@use_count WHERE Prefix == @use_prefix; space=CHANGE_ME; autoaddfields=no}{endif}

```

Then you can copy and paste this snippet into your Text Blaze dashboard snippet editor. In the preview, you will see: "Invalid Data Blaze query - Cannot use a DB command with this query. You can reconfigure the folder to allow access - Configure folder". Press "Configure folder" to allow the snippet to access your space.

Once this is all done, the snippet should work pretty much exactly as you have described 🙂

Please let me know if you face any issues. This is a new beta feature and we can't wait to see the advanced use cases our users build on top of it!

---

_[View the full topic](https://community.blaze.today/t/identifier-generator-insertion/23005)._
