DataBlaze - Insert all rows while maintaining order?

I'm using DataBlaze for information and document requests. Most times I require all rows to be inserted in the order setup within the database, other times, I'd like to manually select rows. Ideally, I would like a one click option to insert all rows while maintaining order.

I've tried grouping but that doesn't work.

Hi @latetotheparty,

If I understand your question correctly, you want to insert rows in a specific order. You can achieve this in Data Blaze by using the sort option. Sort on the Position field which you add to each row. Here, I am inserting 3 rows in Data Blaze using a Text Blaze snippet.

This will insert all the rows on inserting your snippet in the specified order.
Let me know if you have any further questions.

1 Like

Appreciate your solution Ashwin, but I realize that my initial post wasn't clear.

I have a snippet that's inserting rows from a DataBlaze table and would like the rows inserted into the snippet in a specific order from the table, ideally with one click.

I utilized your suggestion to add positions for my row and included 'ORDER BY Position ASC' to {dbselect} which allowed me to select the items in the right order.

However, I have a new question: Is there a way to make my button dynamically add everything from column 'Item' (it's currently hardcoded)?

{dbselect: SELECT Item FROM Table1 ORDER BY Position ASC; space=id; menu=yes; name=product_list;multiple=yes}{button: product_list=[["item": "Item 4"], ["item": "Item 3"], ["item": "Item 2"], ["item": "Item 1"], ["item": "Item 5"]]
; label=Add all Items}

{repeat: for row in product_list}{=row.item}
{endrepeat}

Yes, you can do that using our if-else command as follows:

1 Like

That worked perfectly, thank you so much!