Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #2346548
Conditional Formatting
Closed

Comments

  • Dalton started the conversation

    Just had a quick question about user based conditional formatting. In my WordPress site, if you boil it down, it is pretty much based on 2 things. "Users" and "Tanks". The purpose of this site is so that our customers can go through through and look at the current status of each of their tanks, which is being pulled into WPDataTables through a JSON feed. Depending on how full each Tank is, it will read "High", "Normal", "Low", or "Critical". This helps the user to easily sort by the Tanks requiring the most immediate attention. Currently, I have it setup to change the cell color based on a default value. Which is a good start. What I need to be able to do though, is set that default value to change depending on what user is logged in. Lets say "UserA" has a 10 gallon tank, while "UserB" has a 1000 gallon tank. Obviously these 2 users are going to have different preferences for how low their "Low" setting actually is. So essentially, I would like to be able to put a WordPress shortcode into the number field of the picture I will attach. I imagine the pseudocode would look something like this:

    • If cell value < myCriticalSetting : Set Cell Color To Red
    • If cell value < myLowSetting : Set Cell Color To Yellow

     and so on... Thanks in advance,


    - Dalton

  •  2,498
    Aleksandar replied

    Hi Dalton

    If I understood you correctly, each user would have a different value of "High", "Normal", "Low" and "Critical". That needs to be entered manually in the table, and there can't be a condition between cells, that would differentiate between users. Meaning, you can't add a rule for a column if it overrides another rule:

    5979015121.png

    For example, if these two both had the same sign "<", one would override the other one, and there's no way to have multiple rules for multiple users.

    You would need to have a different table for each tank size. The data can be different for every logged-in user, if you enable Users see and edit only own data, so you could narrow it down, not having to create a table for each user. Unfortunately, I don't see another workaround for this.

    Maybe you can explore some workarounds on MySQL query side. If you can find a solution in that way, then you would be able to do it.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    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