I wish someone help me with generating a list of numbers automatically.
The use case is when user inputs the number of stories of a building (say 20 for 20 stories) and two unit numbers for start and end (say 1 and 10), meaning for each story, there will be unit numbers from 1 to 10, resulting in 101, 102, 103… 110 for the 1st floor, 201, 202, 203…210 for the 2nd floor, and so on.
I created 3 inputs for (1) number of floors (2) unit #-start and (3) unit #-end.
Install the Toolbox plugin, place the list of numbers element on the page and set it to your needs. Then call it when needed as you build logic on your page.
The second question is: HOW do you want to save them?
As a list inside some datatype or do you want to create a record for each number?
Can you share more details about this operation?
The app is for property management operators to manage properties. Each building contains a number of units. As a start, they need to create units (101, 102, 103… 507, 508…1209, 1210 etc), which will be independent fields and each unit field will contain relevant data such as area size, prop type, tenant…
So, 1,2,3,4…10 from floor ListoNumbers and 1,2,3…10 from Unit ListoNumbers must be put together to generate the list of all units within a building.
One more thing particular is that I wish to be able to keep a certain format for each unit number.
Unit No. 1 at the 1st floor should be 11 but want to have it in 101, 102, 103…110, 111, 112.
Units in the 12th floor should be 1201, 1202, 1203…1210, 1211, 1212.
Another option is this plugin: Bubble Back End Utilities Plugin | Bubble
The “Enumerate List” action is a SSA so you can use it both in the backend/frontend + do “Result of step x” and use the list of numbers right in your workflow
@thebubbleprojects I can already tell you’ll need this (or the Toolbox plugin) and the Data API Bulk Create endpoint
And for your data structure you’ll need a number field, a prefix field, and the final name of the suite. That way you can bulk create suites 1 through 10, but apply a prefix to all of it with the floor number.
Don’t forget to cater for exceptions, maybe done manually after the grid is created, for example:
all floors skip unit number 13
floor number 13 skipped
floor 7 starts with unit 3 instead of 1
unit 1201a
Consider storing them all as a single list of texts per building, and only create the actual unit db item when doing something with it … i.e. have a “sparse array”