How to Add Icon and Style Conditionally on Records in Salesforce Lightning DataTable Component (Aura)?
Today, in this solution, we will create a component that displays an icon and text color for Salesforce records based on some conditions in aura using the Salesforce lightning data table.
In this solution, we have signified records based on the colors- if the account record is Active, then that row represents the color green and shows the utility check icon. If it is not active, then it is in the color red. Now, let’s see how we developed the component using the data table!
Let’s start!
Code
Output
Conclusion
There you have it! Wasn’t it the easiest solution for creating a component that displays an icon and text color for Salesforce records ever? We hope that you not only liked the solution but will also implement it for your Salesforce org. Do share your valuable feedback with us if you try it out. Also, if you need further help or assistance in implementing Salesforce solutions, then our experts can help. Get in touch with us. We’ll be back soon. Till then, happy learning! 🙂