We're Moving to a New Support Platform – Starting June 1st!
We’re excited to let you know that starting June 1st, we’ll be transitioning to a new support system that will be available directly on our product websites – Amelia, wpDataTables, and Report Builder. In fact, the new support platform is already live for Amelia and wpDataTables, and we encourage you to reach out to us there.
You'll always be able to reach us through a widget in the bottom right corner of each website, where you can ask questions, report issues, or simply get assistance.
While we still do not offer live support, a new advanced, AI-powered assistant, trained on our documentation, use cases, and real conversations with our team, is there to help with basic to intermediate questions in no time.
We're doing our best to make this transition smooth and hassle-free. After June 1st, this current support website will redirect you to the new "Contact Us" pages on our product sites.
Thanks for your continued support and trust – we’re excited to bring you an even better support experience!
Hi,
I would like to ask how can I have a DateTime column to hold the current date time automatically as the default value of now (when the record is inserted).
Also I do not to present that DateTime column to the user but to I want to see it as the admin in the wpDataTables WordPress panel.
BR,
Arie
Hello Arie.
I am sorry to disappoint you, but unfortunately this is not implemented in the plugin's built in features. However, there is a workaround for this.
For example, I created a simple manual table:
wdt_ID column is being automatically generated, and is usually hidden, but I've displayed it here for explanation purposes.
When I created a table, and added the first row, I could then modify it. So, in order to set the Datetime column to be auto-populated, I had to open the table in the database. It is being stored as wp_wpdatatable_6, and you can see its database name in Editing tab in the settings above the table:
Then, in PHPMyAdmin, I opened the table, and ran the following query:
ALTER TABLE `wp_wpdatatable_6` CHANGE COLUMN `datetime` `datetime` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
After that, again in the Editing tab, above the table, I changed the "ID column for editing" from "wdt_ID" to "datetime" (as you can see in the screenshot above). Then I disabled editing for "wdt_ID" in the column settings:
datetime column, being the "ID column for editing" automatically cannot be edited, but is automatically filled.
You can also choose to hide it from view if you'd like.
I hope this helps.
Best regards.
Kind Regards,
Aleksandar Vuković
aleksandar.vukovic@tmsproducts.io
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Aleksandar Hi,
Thank you for the workaround, one thing I was missing and you set my focus on was the "Editor Input Type" to set it to NONE.
I was able to do the changes a little differently.
1. Added a new Field/column to the table "AddedOn" type DATETIME
2. Set Editor Input Type = NONE
3. In phpMyAdmin set the field to Default value CURRENT_TIMESTAMP
It works !
I did not touch wdt_id, left it as is.
Thanks
Arie
Aleksander hi,
Another thing that I also implemented is to Update the record timestamp in case the record was edited by the user, thus new/modified records can be tracked.
This was accomplished again via phpMyAdmin
ALTER TABLE `wp_wpdatatable_1` CHANGE `addedon` `addedon` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
The addition was "ON UPDATE CURRENT_TIMESTAMP"
Hopw it also may assist others,
Arie
Awesome work Arie
Thanks for sharing that with me! I'm sure it will help other people as well. Good thinking about tracking the modified rows.
Kind Regards,
Aleksandar Vuković
aleksandar.vukovic@tmsproducts.io
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
This has been very helpful-
ALTER TABLE `wp_wpdatatable_1` CHANGE `addedon` `addedon` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP