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 / How do I change the co...
Power Apps
Unanswered

How do I change the color of a certain text inside a gallery

(0) ShareShare
ReportReport
Posted on by 403

Hi, I have a gallery in my power apps.

The gallery is flexible height gallery.

I have a text label inside the gallery(This item.output)

The output will come from power automate.

I want to change the color of the result which is being displayed in a gallery.

I don't want to change the entire text color.

But only certain text . 

Is it possible?

 

For example

The result being displayed in gallery is

This is sample text 1

This is sample text 2

This is sample text 3

This is sample text 4

I want to change the second row and fourth row color. Is it possible?

 

 

Categories:
I have the same question (0)
  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    Yes, for the Color property you can use an If statement if you are using the text itself to determine the color.

     

     

    If(Self.Text = "This is sample text 2" Or Self.Text = "This is sample text 4",Red,Black)

     

     

    If you don't care about the text and only care about what row number it is (always row 2 and 4), you can use the Index function.  I think it starts at 0 so it would look like this:

     

    If(ThisItem.Index = 1 Or ThisItem.Index = 3, Red, Black)

     

     

     

  • Jupyter123 Profile Picture
    403 on at

    @Rusk hey thanks for the reply. Appreciate your time for answering this.

     

    Well, my text result in the gallery changes whenever I run the power automate flow.

     

    It's not static.

     

    Once the user click submit button in power apps, the gallery text result will be displayed but whenever it is getting displayed. I want certain values to have color.

     

    For example, Wherever it starts "D = " or K = " ", just make that line color. Is it possible in this scenario?

  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    You could try this:

    If(Left(Self.Text, 1) = "D" Or Left(Self.Text, 1) = "K", Red, Black)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 899

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 499

Last 30 days Overall leaderboard