Okay
  Public Ticket #3140631
Problem with multiple values in Use values from another wpDataTable (foreign key)
Closed

Comments

  • Jose Cristobal Garcia Aguado started the conversation

    I have seen in the plugin documentation that you can predefine the values of a column. You can Define values list (which allows to choose several values at the same time) and Use values from another wpDataTable that only allows us to use one value in the column, is that true?

    Is there any way that I can fill a column with several values from a foreign key? This is a totally necessary feature for my project and the only reason why I don't know whether to purchase the plugin.

  •  1,846
    Miloš replied


    Hi, Jose

    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.

    -

    In the Data tab, the values that we predefine, are values for filtering, and editing.

    They are not going to determine how many values will be pulled in the cells.

    You can see more details about this on this documentation page;

    in the Foreign keys in advanced filter section:

    3515119266.png

    So, I am not sure I understood what you mean.

    Can you please elaborate a bit more,

    do you mean for the filtering values for this column;

    or the actual values in the cells?

    Thank you

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    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

  • Jose Cristobal Garcia Aguado replied

    I will give an example to make it easier to understand. I have a table of languages (Spanish, English, French etc.). And on the other hand I have a table of novels.

    In the table of novels I have a field that is those languages to which the novel has been translated. I want that field to be autofilled with the values of the language table (idLanguage) but to allow me to enter several languages in that field (for example, the different language ids, separated by commas) since a novel can be translated into more than one language.

    Thanks for your help-

  • Jose Cristobal Garcia Aguado replied

    I have been reading the information in the link you sent me. And it seems that I could only put a single value in the cell, is that so?


    4496237347.png

  •  1,846
    Miloš replied

    Hi, Jose 

    You are correct.  It depends on exactly what you need to do.

    If you need editing as , for example - multiselectbox,  where we can add multiple values together in a cell;

    in that case, that is not possible with foreign key column.

    -

    I will show both examples, first of editing a Manual table with multiselectbox, without a foreign key column.

    If I had a table like this :

    9255902539.png

    And if we wanted to use a multiselectbox for editing the first row of column "Column one":


    7540259548.png

    Then we would be able to choose multiple available values, and add them together in same cell during editing:

    4024865323.png

    6750173577.png

    -

    But, if we use a column configured as a foreign key, in that case  we are limited to only choosing a Single-value selectbox , since the options are limited with respect to what the remote table contains,

    as it is pointed out on the documentation.

    5868149666.png

    -

    So, the only workaround I can see, for your use-case;

    if you have the other table that will hold all the available languages;

    but also if you add a "combination of languages" in a cell;  it will be considered as one "value".

    For example - 

    here I made a random text table,  and added a column "Languages",

    then I created some combination of values :

    6307794749.png

    If I now make a new table, and connect a column to this one, as foreign key;

    1142505031.png

    -

    Then, if I edit, or add new row, in that foreign key column - it will load all the possible values from the original table column ( only available as a single-value selectbox) :

    4454502883.png

    -

    So, there might be a workaround like this - but I am not sure if that will be ideal for your use-case.

    Let me know if that makes sense, I hope it helps.smile.png

    Thank you

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    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

  • Jose Cristobal Garcia Aguado replied

    The proposed solution is not possible since we have up to 17 possible options, and making all combinations of them would be impossible.


    But thank you very much for your help.

  •  1,846
    Miloš replied

    Hi, Jose 

    I can completely understand what you mean;

    for that kind of use-case when there are so many possible values, it is not a good workaround.

    I did my best to try to come up with any alternate solution - but at the moment, as you can see,

    since it is not possible to use multiple value selectbox for foreign key columns;

    we can't change that logic currently.

    -

    Please don't hesitate to open new tickets for any new/unrelated questions, and we will answer as quick as possible.

    -

    If you'd like to see a solution for what you need in the future, you can make a suggestion for our developers.

    Please 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

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    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