web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Color table only line ...
Power Apps
Answered

Color table only line by line

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

 

Hello,

 

I would like to color only certain lines of a data table according to their value in a column of the table line by line for example (it is a table of data of equipment unreachable from a supervision tool) :

 

if the equipment is on alert 2 the line is displayed in red if the equipment is on alert 1 this is displayed in orange ...

with the Fill function and an IF condition of the type :

 

If(status = 2;RGBA(255;0;0;1))

 

Unfortunately I have the impression that the treatment of the tables is displayed by column and that one can not treat the contents, the data of a table.

 

What I want to do is it possible ? If yes, how ?

 

Thank you in advance.

 

Pierre-Louis

 

In French :

Bonjour, j'aimerais mettre en couleur uniquement certaines lignes d'une table de données en fonction de leur valeur dans la table ligne par ligne par exemple (il s'agit d'une table de données d'équipements injoignables à partir d'un outil de supervision) :

si l'équipement est en alerte 2 la ligne s'affiche en rouge si l'équipement est en alerte 1 cela s'affiche en orange ... avec la fonction Fill et une condition IF du type :

If(status = 2;RGBA(255;0;0;1))

 

Malheureusement j'ai l'impression que le traitement des tables s'affiche par colonne et que l'on ne peut traiter le contenu, les données d'une table.

 

Ce que je veux faire est-il possible ? Si oui comment ?

 

Merci d'avance.

 

Pierre-Louis

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Unfortunately, the ability to control a DataTable like that is not available.

    You could convert to using a Gallery instead in which case you would have that ability.

     

    If that causes any issues, post back and we'll expand from there.

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Could you please share a bit more about your scenario?

    Do you want to color only certain lines of data table based on a specific column value?

     

    Based on the needs that you mentioned, I have made a test, and I afraid that there is no way to achieve your needs using Data Table control. Currently, within PowerApps, there is no way to color individual line within the Data table control.

     

    As an alternative solution, I think the Gallery control could achieve your needs. On your side, you could configure a Gallery as a Table, and use the Gallery to list your data source records.

    I have made a test on my side, please take a try with the following workaround:4.JPG

     

    5.JPG

    Add a Gallery wihtin your app, and connect it to your data source, configure it as above screenshot. Within the Gallery, you could add muliple Label controls to display the column values from your data source using the following formula:

    ThisItem.Column1
    ThisItem.Column2

    ...

     

    Set the TemplateFill property of the Gallery to following:

    If(
    ThisItem.Status.Value="Approved", RGBA( 144, 238, 144, 1 ),
    ThisItem.Status.Value="Declined", RGBA( 255, 20, 147, 1 ),
    ThisItem.Status.Value="Submitted", RGBA( 255, 215, 0, 1 )
    )

    On your side, you should type the following formula:

    If(
     ThisItem.status = 2, RGBA( 255, 0, 0, 1 ), /* <-- Render in Red color */
     ThisItem.status = 1, RGBA( 255, 165, 0, 1 ), /* <-- Render in Orange color */
     ...
    )

    Please take a try with above solution, then check if the issue is solved.

     

    More details about the If function, please check the following article:

    If function

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank You for yours Helps, I have succeeded to do what i wanted Smiley Happy

     

     

     

     

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard