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 / Fill colours not worki...
Power Apps
Answered

Fill colours not working as needed

(0) ShareShare
ReportReport
Posted on by 60

In the screenshot you can see 3 items.   1 is Approved, 1 Rejected and 1 Conditional.

 

I want the fill for each item to change based on that Status Field. Status is the DataCardValue18 in the code below.

 

Here is my fill property - Switch(DataCardValue18.Selected.Value,"Approved",RGBA(127, 178, 57, 1),Switch(DataCardValue18.Selected.Value,"Rejected",RGBA( 255, 0, 0, 1 ),RGBA(255, 140, 0, 1)))

 

I've tried "If" as well but same result.   Now if I click on one that says Rejected (should be Red Fill), when I come back from its details to the browser screen (as shown) they will all then turn Red.

 

Help appreciated.  Thx

screenshot cat1.jpg
Categories:
I have the same question (0)
  • RezaDorrani Profile Picture
    12,145 on at

    Hi @Taylope1 

     

    Try

    Switch(DataCardValue18.Selected.Value,"Approved",RGBA(127, 178, 57, 1),"Rejected",RGBA( 255, 0, 0, 1 ),RGBA(255, 140, 0, 1))

     

    Also add a label on screen and set its Text property to DataCardValue18.Selected.Value to ensure it is returning the correct value.

     

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

    Thanks,
    Reza Dorrani, MVP
    YouTube
    Twitter

     

     

  • Taylope1 Profile Picture
    60 on at

    @RezaDorrani 

     

    Thanks for that.  The Light green words (rejected etc) are a label showing the values, so already going that.  Made you change but still does the same.  Also, as before once i select a rejected item, they all go red,  select an approved one, they all change to green. ????

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hi,

     

    Two reasons I can think of for this:

     

    One -

    Do you need to use a dropdown for those items? Are you going to be changing its value on this same screen?

    If its from the same list then just use ThisItem.Status.Value in a label rather than a dropdown/combobox

     

    Otherwise:

    Two -

    When using a gallery, you need to reference an item within a row rather than the control itself if you want to defer to each row's value:

     

    Switch(
     ThisItem.Status,
     "Approved", RGBA(127, 178, 57, 1),
     "Rejected", RGBA( 255, 0, 0, 1 ),
     RGBA(255, 140, 0, 1)
    )

     

    If this is a choice column, then we need to use the .value :

     

    Switch(
     ThisItem.Status.Value,
     "Approved", RGBA(127, 178, 57, 1),
     "Rejected", RGBA( 255, 0, 0, 1 ),
     RGBA(255, 140, 0, 1)
    )

     

    Hope this helps in some way, I'm not certain its the answer but its all I could think of apart from what Reza already covered,

     

    Cheers,

    Sanho

  • Taylope1 Profile Picture
    60 on at

    @iAm_ManCat 

     

    So attached is a grab of my App -  I have created a label that points to ThisItem.Status.Value.  This shows the correct value against each item - no issues.  I changed the Fill value as you suggested (as this is a choice column in my Sharepoint List - but it wont need to be edited here) - then i get a black screen and a message basically stating unable to use ThisItem.Status.Value in the formula (as per second attachment).??

    2020-05-07_14-48-05.jpg
    2020-05-07_14-44-42.jpg
  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    I just tested and confirmed on my end that it only changes once selected using the background referencing the label and that using ThisItem. no longer works for rows... very interesting!

     

    Ok, so workaround for this would be to create a label in the background (note its layered position in the gallery on the left), and then have it's fill based on that same formula - tested this and it works:

    image.png

  • Taylope1 Profile Picture
    60 on at

    All working now. Layering worked a treat.  Many Thanks

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 366 Most Valuable Professional

#2
11manish Profile Picture

11manish 184

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 99 Super User 2026 Season 1

Last 30 days Overall leaderboard