1 column instead 2.

myfatebiz

Active Member
Hi,

I want create a custom form which is involved many element but i don't want create every database column for each element because it will slowdown the listing.

I create 2 field element:
a) description
b) amount

Then it store into single column named payment in json {"description":"","amount":""}

Is that possible?

Thanks in advanced.
 
What do you mean with "slowdown the listing"?

But yes, you can create a form with "Record in database"=no and elements to collect some data and a php form plugin to do something with the data.
 
What do you mean with "slowdown the listing"?

But yes, you can create a form with "Record in database"=no and elements to collect some data and a php form plugin to do something with the data.

If to many column in single database it's will slowdown the listing with large data.

The form still can saved/record in database but with some feature that single column can store 2 elements together without creating a column for each element.
 
Fabrik elements always have an associated column (if the form is saving to DB).
You can set single elements not to save to DB (in access setting) but you will still have an empty column.
You will need additional elements/columns to keep the combined values.
You won't be able to use Fabrik's list filtering on elements not saving to DB.
If to many column in single database it's will slowdown the listing with large data.
How many elements and rows do you want to display at once?
Ususally you have some elements showing in list view and the number of rows is restricted (pagination).
 
Ah to bad can't merge multiple element to single column store data as json.

My listing seem pretty huge element showing that make me need to design custom listing layout. It's over 10 to 20 element showing. And i set limit to 50 data show per-each pagination. This is why my listing show. That why i was thinking about store multiple element into single column as json and this is might be can speed up the listing.
 

Attachments

  • jmb.png
    jmb.png
    237.3 KB · Views: 137
20 elements and 50 rows really shouldn't be a problem.

Time consuming are lists with joins (repeat=yes) or repeat groups and with display set to "merge rows"
 
20 elements and 50 rows really shouldn't be a problem.

Time consuming are lists with joins (repeat=yes) or repeat groups and with display set to "merge rows"

Yes you right. It's seem i have no choice to deal with a lots of database column if need to create for each element.

Can i request a paid feature to add for each element if this is possible?.
 

Attachments

  • features.jpg
    features.jpg
    113.4 KB · Views: 115
If you have many calc elements with very complicated calculations (several mysql queries each etc), the list can become quite slow in my experience.

The way I have dramatically improved the issue was set the list to display e.g. 10-15 items at once and set "only calc on save" to "yes" on some calc elements,
so it doesn't calculate every single element on the fly when the list is displayed. The last option is good only if the calc element doesn't fetch the
data from other tables where the data might have been changed.
 
Calc elements are not thought for "complicated" stuff, at least not with the standard "only calc on save"=no (in this case they are running multiple times on form display and save and for each row on list display).

You may create a multiple dropdown element as in your screenshot or a field or textarea..., fill it with a php plugin on form save and display it in list view.
But I don't think this will save you a lot of time.
 
If you have many calc elements with very complicated calculations (several mysql queries each etc), the list can become quite slow in my experience.

The way I have dramatically improved the issue was set the list to display e.g. 10-15 items at once and set "only calc on save" to "yes" on some calc elements,
so it doesn't calculate every single element on the fly when the list is displayed. The last option is good only if the calc element doesn't fetch the
data from other tables where the data might have been changed.

That why need JSON column to store static data into single column. I can do with calc or php form plugin but my database sure messy because every element need to create database column.

Btw JSON column also can be easy filter by using condition LIKE %%.

Now i have 20++ columns but can go to 5 columns by using JSON column. My database column sure look nice.
 
I really don't understand your problem with many columns. I have lists with >100 without problem (not all shown is list view obviously).
Btw JSON column also can be easy filter by using condition LIKE %%.
Sure, you can. But not differencing between e.g. description and amount.

But go on.
You can do whatever you like with php plugins, custom templates etc.
You can e.g. additioinally create a list copy, disable all "real element columns" and display only your "combined elements".
Or a MySQL list view doing the "combining".
+ custom edit and view links to the "full" form on those reduced lists.
 
I have lists with >100 without problem

Wow single table over than 100 columns. It's scare me.

Sure, you can. But not differencing between e.g. description and amount.

Yes you right. JSON has PRO/CON. In my mind i only use JSON to store data like full name, address, tel, email, description, note and such. Not using for element required for filter range/between like date.

You can do whatever you like with php plugins, custom templates etc.
You can e.g. additioinally create a list copy, disable all "real element columns" and display only your "combined elements".
Or a MySQL list view doing the "combining".
+ custom edit and view links to the "full" form on those reduced lists.

Well like i said, i have no choice have to deal with this. But i still hope in future Fabrik might be able to do the JSON directly from elements. :)
 
I agree with Troester, these numbers of columns should not be a problem at all in normal circumstances. Maybe you have some missing indexes
in your database tables, problems with the server configuration / performance or just very complicated calculations (and only calc on save = no)
in your calc elements. Some calculations can be made more efficiently in list php_events plugin (onPreloadData).

I would start addressing these before trying to tackle the problem with methods which do not align with Fabrik and common practices too well.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top