Okay
  Public Ticket #3248638
Post author to see data only in table when using Forminator form upload as data source.
Closed

Comments

  • David GRASBY started the conversation

    Hello, sorry I can't provide the website URL as the site is currently being developed only.

    I am using the Forminator plug in to allow users to upload information to the site. I am attempting to create a table for logged in users to view there own posts only.

    I note that the edit tab is only available when creating a table manually. Is there a specific process to enable this function when importing the data from a Forminator form and using the wpDataTable integration plug in?

  •  1,850
    Miloš replied

    Hi, David.

    Sorry for the delay.

    Yes, there is a custom workaround you can do to achieve limiting rows to show only the rows/submissions that are made by the currently logged user ID.

    Here is my 'test example' with just a very basic Form and one Text field.

    First you have to add a hidden field of type "user ID" to your Forminator Form.

    9710349866.png

    Now, any new submission any user makes, this field will store their user ID.

    Then, i just added a couple of submissions , the first one by my Admin user, which has user ID of 1;

    then i log as another user, with user ID of 11, and add another submission.

    By default, i have just left the field name without setting it up at the Form, and the table picks up this field as origin header of "hidden1".

    6733523157.png
    6107479450.png

    We can change the Displayed Header name to anything, i name it "user ID",

    and of course, you can hide that column from front-end users if needed, i just left it for demonstration purpose.

    -

    Now, i will explain how you can use this user ID field to pre-filter the table for front-end users,

    and also you can hide the filter with CSS - to prevent any user to "clear the filter" in order to see everyone's subbmisions.

    -


    This is a detailed example of using an Excel table - but you can use absolutely the same principle/logic for table linked with your Forminator Form.

    - On this Excel, we added a custom "user_id" column on the source Excel side, which you can hide if needed in our plugin from the front-end.   ( On your Form, you will already have that hidden user ID field as mentioned above);

    We will add a predefined filter value to that column, using a PlaceHolder "Current User ID";

    - Check that the filter type is set as "Text", as shown on this screenshot.

    8249361981.png

    - Here is how an example table linked to a source file looks before we make any changes, with visible filters above the table.

    7932387639.png

    And now, when we set the pre-filter, with Administrator logged in ( In our case, the user ID is 1), we only see rows matching that user ID.

    3633379684.png

    - (If you need more detailed information about using Place Holders in wpDataTables, here is our documentation about that https://wpdatatables.com/documentation/table-features/using-placeholders/);

    - The user_ID filter is still visible, which means, if someone changes/deletes this value, they could see the whole table.

    We will hide it from the front-end with some custom CSS added in the "Customize" section of the main table settings.

    - It should be easy to do, depending on your knowledge of HTML and CSS.

    You have to find the correct selector using the browser inspector tool, add the style "display:none" property to it, and it will disappear from the front-end.

    On our example table, the custom CSS is :

    #table_1_5_filter_sections  {
        display:none; }
    5537273103.png

    - Now, the user_ID filter is gone from the front-end.

    8120839900.png

    - Optionally, you can hide the user_id column from the front-end, if needed, either using the column settings tab or the "column list" button from the back end Admin area.

    1618300341.png

    - If you need more details about this, don't hesitate to contact us further.



    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

  • David GRASBY replied

    Thank you so much for this information, it worked perfectly.

  •   Miloš replied privately