Okay
  Public Ticket #3637211
combine tables so that one table will contain data from several different tables
Closed

Comments

  • Łukasz started the conversation

    Hello,

    I have a question, I would like to create several tables with data:
    - a summary of purchase invoices
    - a summary of salaries
    - cash status (cash flows)

    My question is:

    Can I make it so that, for example, in the "summary of purchase invoices" table, there are the following columns:
    - invoice issuer (data dynamically pulled from another table with a list of issuers)
    - invoice number (entered manually)
    - payment information, e.g., I will add information that 100 USD was paid and it will be recorded in the cash balance table (another table)

    Is it possible to combine tables so that one table will contain data from several different tables and they will affect each other?

    QUESTION NO. 2:

    When I choose the data type ATTACHMENT, is there a possibility to load several attachments into one row? Because now I see that there is only one.

    Best regards,
    Łukasz

  •  1,805
    Miloš replied

    Hi Łukasz,

    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.


    1. When it comes to building relations between several SQL Tables, to call all the data in one table, there can be two ways :

    1. If you use an SQL JOIN with a custom SQL Query, you can join all the data into one table.

    But if you need to have editing with our Plugin on this Table, a table made from SQL JOIN can not be edited.

    You can see more about this limitation on editing on this Page.

    9813045580.png
    • Only one MySQL table can be edited at a time. Queries from multiple tables with joins cannot be used as an editable feature, since SQL UPDATE and INSERT statements are generated automatically, and there currently is no way to update multiple tables.


    2. The only way to have editing possible while calling data from another Table can be done with our native foreign key relation feature.

    Please check more details here with our example where we made an SQL Query table which calls data from multiple foreign key columns.

    2. Now, this part, I am struggling to visualise all this functionality and all the relevant data just from the text as you wrote :

    Can I make it so that, for example, in the "summary of purchase invoices" table, there are the following columns:
    - invoice issuer (data dynamically pulled from another table with a list of issuers)
    - invoice number (entered manually)
    - payment information, e.g., I will add information that 100 USD was paid and it will be recorded in the cash balance table (another table)


    Could you please try to elaborate more on this part, try to show us any examples and add screenshots or even better record a Video to show us a 'mock up' how the data should be related and how it should work?


    3. Is it possible to combine tables so that one table will contain data from several different tables and they will affect each other?

    This is related to the first point.

    It depends in which way you need to 'merge/join' the data and if you need the editing from one table to save the data in all tables.


    If you need to have editing, then you can only edit one Table, for example, if you call a foreign key column with the native feature we have;

    the value will be stored as integer in this/current SQL Table, while it will only pull from the available unique values for editing from the foreign table's column.


    So you can make several foreign key columns and they are editable, but only as single value selectbox;

    and the value gets stored as integer in the source SQL Table as the chosen 'Store value';

    while the 'Display value' is only shown visually in our Table.

    6667023111.png

    Please check more about that explained in our Foreign Key Relation Documentation sent above.


    Let me know if you have additional questions;

    and if there is a need to go in more details or if this perhaps already covers your main points of the use-case?


    Thank you.

    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