Does your data require sequential batch numbers or perhaps an auto increment attribute? An automation to create unique row IDs can let Honeycode do the work for you. Here's how you can do this.
Say you're taking customers' clothing orders. Your app has two fields: Customer Name and Clothing Order. Each time an order is submitted via the app, a table row is added with the customer name, clothing order and a new unique row ID. Check out the video!
- Build two tables as shown below.
- Navigate to Builder > click the [+] sign > click Build your own > select the CustomerOrders table > click + Add objects.
- Add a Column List and a Form.
For the column list object, select the CustomerOrders table and include the three columns (Unique Row ID, Customer Name, and Order Details). The other tick boxes are optional, but not necessary for this walkthrough. Once you create this, the list will be added to the screen.
Then click on the form object, and select the option that includes the button. And select the CustomerOrders table and include the three columns (Unique Row ID, Customer Name, and Order Details). Once this is created, you will have a form screen.
- Navigate to the CustomerOrders form screen > click the Done button > click Edit automation on the Actions panel.
- Delete the contents of the $[Unique Row ID] Take data from box and write
=FINDROW(ID_Primary)[ID Primary]+1, and select as a: Value.
Builder tip: You can delete the Unique Row ID and the [$Unique Row ID Content] from the visual editor's Block so your end users don't see these fields.
- Click + Add actions > select Overwrite.
=FINDROW(ID_Primary)[ID Primary]+1in the Take data from box > Enter
=FINDROW(ID_Primary)[ID Primary]in the and write to box > select as a: Value.
- Click the View app button on the upper right to see your automation in action!
Builder tip: You will notice in your ID_Primary table, that it is storing a value to prevent any repeat Unique Row IDs. They way our formulas are written prevents it from having more than one row, as the automation continues to add
+1to the that row and overwrite it's value for each new order.
|Was this article helpful?|