I created a new data table manually, then I configured my columns and one of them should take data from another wpdatatable column.
So I selected column settings_data_use data from another wpdata table _ configure relation, so I selected the table and column and saved, but no data is leaded. I tried it with many different table sources with no success.
Then I simply tried to define a value list (see the enclosed picture) and saved, but nothing again!
You probably misunderstood the feature. Foreign Keys are used to pull the values from another table's column when editing. The plugin cannot automatically pull the data from another column.
The only way you can do that would be to create an integer column, define values in it (1, 2, 3, 4, 5....), and then configure the relation to another column.
In that case, the way you connected the column (from your screenshot) will not work because you chose the same column to be the store and the display column. Store column should be an integer column to which the IDs you set will be linked to, and the display column will display the data of the chosen column from a row where the store column has an integer.
Hello, I have been checking on the foreign keys in the website, seems like a lot of users are looking for automatically pull data from another table to current table.
For example, you have a table called Order and you have a foreign key to Customer. You want to display the customer's first name, last name, and DoB and display them all in Order table. Now, what you can do is manually select them from the dropdown, or a better way (I have not tested but probably will work), is to use the hook to update those values.
With built-in features of the plugin, you have two options:
1. What you mentioned - create the relation, and add the values using drop-downs while editing the table.
2. Create an Excel table (for example), which will contain the IDs of all columns you want to change using the foreign key feature, like you did in the Order table example. Then, when you import that table, configure the relation, and all numerical values will be replaced with the values from the remote table.
Of course, you're welcome to use any custom solutions, but that doesn't fall under included support for the plugin. You can add it as a feature suggestion on this page, and hopefully our developers will be able to add it as a built-in option in one of our future updates.
Thanks for your reply. Well, I am just suggesting a workaround for users how to pull data from other table to your current table as though you are pulling it in sql way.
Technically speaking, this should work (haven't tested) but it would be ugly to find all the same foreign key value on multiple columns.
Thanks for the suggestion, Issac, I will forward it to our development team.
We definitely have something similar planned for the future, but I can't say when it will be worked on. The idea is to pull data for an entire row based on one foreign key, but that will require a lot of coding hours, and testing, so I don't see this coming in the near future.
Hello
I created a new data table manually, then I configured my columns and one of them should take data from another wpdatatable column.
So I selected column settings_data_use data from another wpdata table _ configure relation, so I selected the table and column and saved, but no data is leaded. I tried it with many different table sources with no success.
Then I simply tried to define a value list (see the enclosed picture) and saved, but nothing again!
Please help me
Hello Emanuele
Thank you for your purchase.
You probably misunderstood the feature. Foreign Keys are used to pull the values from another table's column when editing. The plugin cannot automatically pull the data from another column.
The only way you can do that would be to create an integer column, define values in it (1, 2, 3, 4, 5....), and then configure the relation to another column.
In that case, the way you connected the column (from your screenshot) will not work because you chose the same column to be the store and the display column. Store column should be an integer column to which the IDs you set will be linked to, and the display column will display the data of the chosen column from a row where the store column has an integer.
Kind Regards,
Aleksandar Vuković
[email protected]
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
Hello, I have been checking on the foreign keys in the website, seems like a lot of users are looking for automatically pull data from another table to current table.
For example, you have a table called Order and you have a foreign key to Customer. You want to display the customer's first name, last name, and DoB and display them all in Order table. Now, what you can do is manually select them from the dropdown, or a better way (I have not tested but probably will work), is to use the hook to update those values.
So this will be what you might see:
Order table
------------------
wdt_ID | customer_id | first_name | last_name | dob
1023 2 2 2 2
Customer table
-------------------------
wdt_ID first_name | last_name | dob
2 issac chua 12/12/1982
Hello Issac
With built-in features of the plugin, you have two options:
1. What you mentioned - create the relation, and add the values using drop-downs while editing the table.
2. Create an Excel table (for example), which will contain the IDs of all columns you want to change using the foreign key feature, like you did in the Order table example. Then, when you import that table, configure the relation, and all numerical values will be replaced with the values from the remote table.
Of course, you're welcome to use any custom solutions, but that doesn't fall under included support for the plugin. You can add it as a feature suggestion on this page, and hopefully our developers will be able to add it as a built-in option in one of our future updates.
Kind Regards,
Aleksandar Vuković
[email protected]
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
Hello,
Thanks for your reply. Well, I am just suggesting a workaround for users how to pull data from other table to your current table as though you are pulling it in sql way.
Technically speaking, this should work (haven't tested) but it would be ugly to find all the same foreign key value on multiple columns.
Thanks for the suggestion, Issac, I will forward it to our development team.
We definitely have something similar planned for the future, but I can't say when it will be worked on. The idea is to pull data for an entire row based on one foreign key, but that will require a lot of coding hours, and testing, so I don't see this coming in the near future.
Kind Regards,
Aleksandar Vuković
[email protected]
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