Okay
  Public Ticket #2838095
Different users same table
Closed

Comments

  • Márcio Cristiano Bento started the conversation

    Hi there,

    I'm really interested in buying this plugin and add-ons, however, I have a pertinent question. My client needs to create a partner's database to show some information like funding, nº people that were helped, area of operation, etc.

    However, each partner needs to have their own account on the website and update their own details, and can't change other partner's information. Is that possible?

    For example Pepsi and Audi are partners. Pepsi is able to change Pepsi's details. And, Audi is able to change Audi's details. BUT then there is a dashboard/table with both of their informations that are public available and needs to be exported by pdf or excel sheet. Is that possible? Let me know if you have any questions

  • [deleted] replied

    Hi Márcio

    Thank you for reaching out to us.

    You can link data to specific users with our plugin. To do this the table needs to be editable (so you would need to import the file, to create a manual table), and also you need to have the User ID field in the table. Meaning, if John has user ID = 5, when he logs into your WordPress site, and looks at the table, he'd only see his data if you selected the User ID column as the "User ID column" in the Editing tab above the table. If there's no user ID column, and they aren't logging into WordPress, this will not work.

    You can also add the placeholder %CURRENT_USER_ID% as the predefined filtering value in column settings of "User ID" column, and the table will automatically be filtered per the ID of the currently logged in user. You can enable the Show all rows in back-end option from the Editing tab of the table to see all entries in the back-end. You can also edit the table but if you edit the table as an administrator your User ID will be saved when you make the change so make sure to turn off the Users see and edit only own data option before editing.

    Please see the video below

    How to create editable tables in WordPress where users edit only own rows - wpDataTables 2.0

    If you want to have a specific column shown for all users you will have to add user ID number 1 next to each one of the values in that column, then copy and paste the same row values below and add user ID number 2 next to them and so on for as many users as you have. You can use the Excel like editor to copy-paste the values so you wouldn't have to add them manually one by one.

    6554549139.png

    You can set this column not to be editable by setting Editing to None, so the users will be able to add the data in the empty fields only.

    Unfortunately you will not be able to display the entire table with this option turned on but you can create an SQL query based table that would pull all information from the previous table and display both on the same page.

  • Márcio Cristiano Bento replied

    Hi, thanks for this reply!
    I need that information to be public to everyone but the partners can only change their own info. I don't think that solution will help with that, am I wrong?

    What about this approach? What If I create a CUSTOM POST TYPE, with all the fields I need from the partners using ACF (is wp data tables compatible with ACF)

    Then, I can create each partner page and assign it to a specific user.
    Then I would have a table taking information from the Custom Post TYPE, would this work?

  • [deleted] replied

    Hi Márcio,

    thank you for the kind reply!

    Blazenka is out of the office at the moment, so I hope that you don't mind me replying.

    Are you using ACF Repeater perhaps?

  • Márcio Cristiano Bento replied

    Could be ACF repeaters or just text/number fields

  • [deleted] replied

    Hi Márcio

    I am sorry to disappoint you, but unfortunately something like this is not possible with the plugin's built-in features.

    We don't have a native integration with ACF, so pulling data from it is only possible by using SQL query based tables. If you're able to pull these subfields in a different column, it might work, but in that case, to make any sense from them, you would need to disable server-side processing (available only for tables with less than 2.000 rows) and use row grouping.

    Please note that writing custom queries is not included in the provided support for the plugin, so I wouldn't be able to help you with that.