Services Plugins FAQs

How to filter data before being displayed to users (Editable Data Table plugin)

Hi,

My question concerns the Editable Data Table plugin. Is the plugin able to filter lines before displaying the information to the current user?

An exemple:

  • I have a client table, whose one of the columns contains a seller ID.
  • When a seller logs in (“Current user is logged in” parameter), he is only able to see and modify the lines based on the seller ID.

The objective: avoid a seller to access or modify client data related to other sellers.

Thanks,

Hello, @boursio. Thank you for your question.

Let me please inform you that your question is under investigation. When I have any useful info, I will let you know at once.

Thank you for understanding :pray:
Regards,

@boursio,

Thank you for waiting :pray:

Technically, it is possible to add Editable table rows filtration before displaying the info to the current user.

I have managed to test this feature with the user email parameter. Please take a look at the flow.
(My test table is called here a “Test_table” respectively.)

  1. Create a table in the database. Set some fields in Data Type, add the Email field neccesarily.
    http://prntscr.com/sd6sza
    http://prntscr.com/sd6tbx

  2. Create an Editable table element, set the list of tables to be displayed.
    http://prntscr.com/sd6toe

  3. Set the data source for your Editable table
    http://prntscr.com/sd6urp
    and add the constraint to the table’s data source
    http://prntscr.com/sd6vkr
    By this, the table will show the rows to the Current user only if the user’s email equals to Emai field value, listed in your table.

You can also set the hiding condition to the table, so it won’t be shown to the unauthorized user: http://prntscr.com/sd6x56

Here is how these all running: https://www.loom.com/share/3b6e37412d824d38b46f6b09f4b25d2e

I hope this guide will be useful to you.
Regards,