Okay
  Public Ticket #3234742
Storing files in data tables
Closed

Comments

  • Michael Montefusco started the conversation

    Hi there!

    So I currently use Notion for client dashboards but would love to use WordPress.

    One usage I don't know how to pull off is to have a table that the client can edit on the front end (add rows, change text).It needs to be accessible via an API (we use these databases for running automations in Make.com.) And it needs to be able to have a column that can handle files (PDF's and some images here and there).

    Is it possible to get WPDataTables to be a part of a stack that can do this? I also have MetaBox which I can use or am open to needing other plugins to make the whole thing happen. 

    Thanks in advance for your reply!

  •  1,850
    Miloš replied

    Hi, Michael 

    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 am sorry to disappoint you, but with the current plugin's capabilities, you will not be able to link the source data via API while also being to edit the table on the front-end.

    Only SQL based tables can be edited with our plugin( Manual tables and SQL Query-based tables).

    -

    We do have the capability for columns to store a link to a PDF, images, text,

     you can also combine them in same cell, if you wrap it in custom HTML in our String columns,

    but the main issue will be the editing.

    And if i understood you, this data for the tables would have to be accessible via an API?

    Our developers will be working on our API in the future, but I can't say an exact ETA on it.

    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.

    -

    If you have coding skills and wish to try to make a custom solution now,

    you can check out our available hooks for Developers on this documentation and see if you can find any hook that might help.

    Please be advised that custom solutions are not included in our support.

    You can also research resources such as Stack Overflow to see if any other user perhaps found a workaround.

    ( We do like to give examples for certain solutions, but for this use-case, we, unfortunately, don't have anything yet)


    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

  •  1,850
    Miloš replied

    Hi, Michael 

    I just found another case from some time ago when another user asked if they could send the data from database tables/editable tables, to Rest API.

    I am not sure if this information will be useful for your specific use-case, but i will share it.

    If you need to send table data to an API,

    at the moment, with our plugin's built-in functionalities, there is no way to achieve this.

    Our developers did not create a PHP API or REST API for our plugin yet,

    there weren't many requests for it in the past;

    but a couple more people have been asking for it recently.

     We have it on our "to-do" list, but the features suggested on this page were more about other features and improvements for the plugin.

    Please feel free to add this as a feature suggestion on the page linked above, so the number of votes goes up. We develop new features based on the number of votes received from our customers, so your vote can be beneficial to have this included sooner.

    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.

    -

    At this time, if you have coding skills,

    you could make custom routes that you would write yourself,

    and you would have to create the logic that will pull data from the database that you need for tables,  and to send them.

    You can also check our available hooks for developers here.

    A custom workaround like that would not be covered by our support.

    It probably can be done with some custom work, but our developers are very busy at the moment, working on some priority tasks and fixing bugs and issues with our plugins, so they won't be having the time for custom work in the near future.

    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

  • Michael Montefusco replied

    I can just access MySQL through an API. I'm more concerned if I can someone have a PDF in a column actually?


    Also is it possible to have line breaks in text in a MySQL VARCHAR() column somehow? I want people to be able to create line breaks in a column that gets entered manually from the front end. Can this be done?


    Thanks!

  • Michael Montefusco replied

    Just found the documentation on using an HTML line break and it worked!!!

    Can you share any docs on how I can store a PDF in a cell? Is that possible?

    I really love this plugin by the way. I taught myself SQL just to be able to use it is one of my fave AppSumo deals of all time (As you can tell, because I own almost all the add-ons, haha)

  • Michael Montefusco replied

    And the next hurdle is if I can use emoji in a cell. It gives me an error, any tricks to this you can share?

  •  1,850
    Miloš replied

    Hi, Michael.

    1. If i understood, it seems that you will be able to devise a way to use API to access the MySQL source data for the tables?  If that's the case, happy to hear it.smile.png


    2. In regards to storing a PDF in a cell of a table,

    I will double-check this with our 2nd level Team, but as far as I am aware, it is not possible to store the actual PDF file in a cell in the database table,

    you can just make a link that will lead/redirect the user to the PDF, 

    then they can view/download the PDF in the browser, in same tab/ or in a new tab, depending on how you set up the link ( if you add the target attribute).

    In other words, you would have to store the PDF somewhere else and wrap the path of it into a link/ or a hyperlink / or a button, 

    in a String column, or an URL column.

    I will report back when I check to be sure, if our 2nd level Team knows of any other way  - and if it's possible to store the actual PDF file in the database table.



    3. In regards to making new lines with our plugin;

    correct - if you use a One-Line String column ( VARCHAR in the SQL database table),

    if you manually input the HTML, you can use <br> tag for a new line,

    or you can use Editor Type for the column as "HTML Editor", which allows you to press Enter for new lines,

    but in the background code it is going to wrap the data in HTML paragraphs.

    6668406850.png
    8563179518.png
    6632989961.png


    4. Emoji's in cells :

    Basically, it is related to the default collation/charset of the WordPress database, where all the tables are created/stored. It is not allowing emojis to be stored.

    - I might have a workaround for you. 

    After importing the data without emojis to create a Manual table,

    here is an example. 

     I created a new import from Excel, at first with emojis removed. ( made sure to set any columns that can have longer text as multi-line strings);

    And ,I get this error if I try to paste an emoji anywhere while editing a cell. ( value contains invalid data)

    9438064923.png

    - First thing to do is to change the entire default charset+collation of the WordPress database.

    In my case, my WordPress database name is "current", it will be different for you.

    There are two ways, manually through phpMyAdmin :

    Select the database, go to "Operations", and change the collation as shown, to utf8mb4_unicode_ci

    1652247447.png

    - or you can run an SQL Query on the database, like this :

    ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

    -

    Now, in the editing tab of the table in WP-Admin, you have to check what is the table name in WP database - You can do this by enabling front-end editing ( you can later disable it, if needed)

    in my case  table name is  wp_wpdatatable_19 :

    3958212676.png

    Then, if you use phpMyAdmin, make sure to select the correct table from the left side, then run an SQL query on the top, and press "Go" button on the bottom right :

    ALTER TABLE wp_wpdatatable_19 CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    

    4209887844.png

    and now it allows me to paste any emojis on the table.

    6566524222.png

    I am hoping this workaround is not too complicated. It does take a couple of steps to achieve,

    but once you change the table's collation successfully, it will allow you to paste any emoji's and special symbols.

    -

    Let me know if you have any question for the other points; and I will come back about the PDF point #2.

    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

  •  1,850
    Miloš replied

    Hi, Michael.

    Following up on #2  about PDF's.

    Our level 2 Team confirmed that there is no way to store the actual PDF file in a SQL database.

    So, in our plugin's dataTables, you can only place a link in the cells that leads to the source location of the PDF.

    Let  me know if you have any additional questions. 

    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