Hi, Iโve got a feature that I want to add to my clientโs app and Iโm wondering if thereโs a smart way to do it.
The app is part of a factory workflow, and every time a factory worker starts or ends a new batch, they need to fill out a number of maintenance fields. Sounds straightforward enough - however, my client would like to be able to edit the fields in the app itself - so they need to be dynamic.
I have another part of the app like this for leftover materials, but thatโs more straightforward because the fields for the material entries are always the same - text name of material, decimal amount of material.
I handle it by having the materials table โbelongโ to the batch table, and just generating x rows in leftovers (based on another table called Material Types) related to the batch which can be edited in the batch.
However, the maintenance part is more complicated because the questions could be text, number or yes/no (maybe more things). What I want this to be is a simple table with โMaintenance Itemโ and โValueโ, and the user fills in Value, but the Value is not necessarily always the same type.
One idea I had to get around this was to have three different columns for potential values in the maintenance table and only showing one of them depending on the type, but A) this is going to be an inline table so it will not display properly if I do that, and B) it will probably make something else break later.
Alternatively - is there a way to add/remove/edit COLUMNS themselves from an app? That would be even better, as I wouldnโt have to break up the form with inline tables.
Thanks,
Alex
Solved! Go to Solution.
Iโve been tracking may daily activities for several years with an app structured this way.
You could create a virtual column that populates with the textual representation of whichever column contains a value and include this virtual column in the inline table rather than the typed columns.
Changing the column type dynamically is not possible. How about if you use Enum field with fixed values like Yes and No. If you set the option โAllow other valuesโ as ON, you are able to write text, number, decimal etc. If you need to use number somehow in another place in your app, you can then convert it to a number like NUMBER([EnumColumn]) or DECIMAL()
Iโve been tracking may daily activities for several years with an app structured this way.
You could create a virtual column that populates with the textual representation of whichever column contains a value and include this virtual column in the inline table rather than the typed columns.
virtual column
oh Steve youโre a legend, this is the solution, thanks
Hi,
I think I have a question about the same case. I have in the data model and app user-defined attributes in addition to the app/entity relevant ones (set up tables for customfields: datatype, list of values . With one table with all rows connecting with user-defined data linked to the relevant other table in the app)).
I am now stuck at the point that I would like these custom fields to be presented in 1 form. Not a (inline) table view to update each custom fieldโs value independently, but the whole set of customfields in one form. Is there a more elegant way than creating an extra table with for all -relevant - datatypes colums 1โฆ20 and making them visible_if (and transporting the data back and forth)?
User | Count |
---|---|
16 | |
10 | |
9 | |
8 | |
3 |