cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pierre-Louis
Level: Powered On

Color table only line by line

 

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

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Color table only line by line

Hi @Pierre-Louis ,

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 Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Color table only line by line

@Pierre-Louis 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Community Support Team
Community Support Team

Re: Color table only line by line

Hi @Pierre-Louis ,

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 Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Pierre-Louis
Level: Powered On

Re: Color table only line by line

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

 

 

 

 

 

 

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,784)