Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #3615933
Relational Databases
Open

Comments

  • Tony Mole started the conversation

    Hi - Sorry, but I cant send a link to the URL as the site is hosted on a local server for testing purposes.

    I am experimenting with relational databases / foreign key having watched your tutorial online. In your example you have a database called 'employees' which contains the employees names & date of birth. You then have a second database called 'rotas' which allows you to select the employee from a selectbox. This all works perfectly, thank.

    However on my stystem I would like to select an employee from a dropdown box in the rota database, but as well as the employees name, I would like their date of birth listed in the rota table... is there a way of presenting the employees corresponding date of birth in the rota table, when you select a particular employee?

    Thanks

  •  1,692
    Miloš replied

    Hi Tony,

    If I understood, basically, you wish to call the values from two columns from the Foreign Table, the Employee's Name and also the Employees Date of Birth information?

    I am sorry to disappoint you, but that will not be possible with our current capabilities.

    -

    For our Foreign Key Column - in the relation, it can only be a 1 to 1 relation.

    So, for example, you can not call one Foreign Key Column and chose the Employee name there from the dropdown, while having it auto-populate another Column with values in that row corresponding Employee Date of Birth.

    -

    The only way to present data like that is to make two Foreign Key Columns in your Table;

    then create the same 'store value' chosen in the both Columns, and just set :

    - Foreign Key Column 1, 'store value'  as the unique row identifier which is the Employee ID reference from the 'employees table',   then the 'display value'  will be chosen as the 'employee name' column;


    - And the Foreign Key Column 2,  same 'store value' ( id column) should be chosen, just choose the 'displayed value' as the 'Date of Birth' from the foreign Employee Table.

    -


    But I realise this is not the intended solution for the specific editing use-case you have to make it easier.

    The only idea I have is to maybe first set the 'display value' to the Employee name;

    Then edit some rows, and when you finish editing, change the 'displayed value' in the foreign key relation for the Column to the 'date of birth' - so then, because our Table is storing the "row ID" as integer in the Database, you can change it to any other displayed value and it will look it up by the Employee ID.

    This is an interesting idea for a future option, though, ( to choose Employee Name but load Date of Birth in the edited field) but as you can see, it is not possible at the moment.

    If you wish to see an easier solution, other than the workaround, feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia 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

  • Tony Mole replied

    Hi Milos

    Thanks for the reply... you are correct... I would like to choose the employee name in the rota table... but have a separate column also in the rota table where the date of birth from the employees table for the employer selected would be displayed.

    I tried to follow your instructions, but in my rota table, when I select an employee I just get the employees name showing in the employee and date of birth columns... so am not sure if I am following your advice correctly.

    I will play some more and also search your suggestions page to see if anyone else has offered a solution.

    Thanks,

    Tony

  • Tony Mole replied

    Hi Milos

    As a work around I created another table with the two columns (Employee Name & Date of Birth) I need to get displayed in the main table... I then used the CONCAT function in my data source table to create a third column which shows the Employee Name and Date of Birth in a single cell. I then tried to create a relationship to display the information in this cell, but the master table only shows the wrt_id integer and wont display the string contained in the CONCAT'd cell.

    Is this correct, or am I doing something wrong?

    Thanks

  •  1,692
    Miloš replied

    Hi Tony,

    Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. 

    I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.

    I would need to take a closer look at the solution you tried, then we will be able to advise more.

    It is difficult to visualise everything just through text like this.

    Could you please record a video of your screen and show me what you tried so far;

    1. First you could try a simpler way, as you tried before;

    basically as I advised, so you would first add another Foreign Key Column, the same way as you did for the "employee name";

    so you would pick some unique integer value as the 'store value';

    then pick the 'Date of birth' as the 'displayed value'.


    Just make sure, when you are creating this Column, it has to be saved as integer on your source SQL Table.

    If you make a Manual table, create it as integer ( so it gets saved in the DB as integer);

    then change it to String, in column settings of our Plugin;

    and choose your Foreign key relation fields.


    All this is explained on our own example on the Foreign Key Documentation Page, how we create the SQL relations;

    so please go through our example and compare all the steps with how you create your relation;

    maybe you can find a discrepancy or a 'wrong step' this way.


    2. You can also try again with the CONCAT function, just show us more details in a Video how you created all this, etc;

    If the Video  gets too large, you can upload it to weTransfer and send a download link.


    Also, if it shows any sensitive details, make sure to set the reply as PRIVATE for security reasons.


    3. And finally, we can remotely log in and we can try to make a duplicate Table and try to modify it for you to make a solution.

    Please provide me a temporary WP-admin (administrator) user for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. 

    We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course, we do not provide login data to third parties. 

    You can write credentials here just check PRIVATE Reply so nobody can see them except us.

    And point me to the Table iD.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia 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