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 / set specific color for...
Power Apps
Suggested Answer

set specific color for Gallary items base on the text label outside the data source.

(2) ShareShare
ReportReport
Posted on by 190
Dear experts
 
Good day.
 
I would like to set color for Gallary items that has been scored base the the Text lable from other data source. 
Would you please help to provide some guidance on it. ?
 
Thanks in advance
 
Categories:
I have the same question (0)
  • Suggested answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at
    Hello @GGG666

    If your score is coming from another data source, you can use a LookUp function to bring that value into your Gallery and then apply the condition for color based on it.

    Select the that Rectangle or if you want to apply gallery in Gallery then select the Template Fill property in Gallery. 

    Example

    With(
        {
            scoreValue: LookUp(OtherDataSource, ID = ThisItem.ID, Score)
        },
        If(
            scoreValue >= 45, Color.Green,
            scoreValue >= 35, Color.Orange,
            scoreValue >= 0, Color.Red,
            Color.Gray
        )
    )
    
    //OtherDataSource - Replace with your other data source
    //ID = ThisItem.ID - Replace this condition based on your configuration.

    Note: Please make sure replace the above lookup condition as per your configuration. Also, please replace the color condition based on your score range.

    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
    ---------------------------------------------------------------------------------

    📩 Need more help? Just mention @Kalathiya and I’ll be happy to assist.

    ✔️ If this answer helped you, please tick “Does this answer your question?” so it can be marked as the Verified Answer.

    💛 A Like always motivates me to keep contributing!

  • Suggested answer
    11manish Profile Picture
    3,333 on at
    To set color for Gallery items based on a value from another data source, you need to match records using a common key (e.g., QuestionID) and use LookUp() to retrieve the score.
     
    Then apply conditional formatting (If/Switch) in TemplateFill or control properties based on that value.
     
     
    Try like below :
     
    Identify common key
    You need a common field between:
    • Gallery data → e.g. QuestionID
    • Score data → e.g. QuestionID
    Get score from external source
    Use LookUp() inside gallery
    Example:
    LookUp(
        ScoreDataSource,
        QuestionID = ThisItem.QuestionID
    ).Score

    Apply color in TemplateFill (or Label Color)
    Example (color based on score)
    If(
        LookUp(
            ScoreDataSource,
            QuestionID = ThisItem.QuestionID
        ).Score >= 8,
        Color.Green,
        Color.Red
    )
     
     
     
  • GGG666 Profile Picture
    190 on at
    Hi Thanks for your reply,Though “ThisItem” in the code is not recgonized 
     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard