cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Edwardm
Level: Powered On

browsegallery item color change with toggle in detail screen

Hi, I have started an app, inventory app, where I would like to use a toggle in the detail view for each item to mark the item as out of stock. I have tried the fill property of the labels text color. The color changes on all of them when I toggle. How can I target only the item I actually toggle the switch on? In the sharepoint list I see the value reflected correctly, so it looks like I'm changing the template, but I see no other way of doing this.

 

I use this in the color property of the text: If(DataCardValue5.Value=false; Green; Red) 

DataCardValue5 beeing the toggle

 

This is how it looks when testing 🙂

 

Untitled-1.png 

 

Edward

1 ACCEPTED SOLUTION

Accepted Solutions
Edwardm
Level: Powered On

Re: browsegallery item color change with toggle in detail screen

Thanks, I did mess around with thisitem, and I had to use this to get it working. It reference the name of the toggle column in my list, and not the datacardvalue.

 

If(ThisItem.Available=true; Green; Red)

View solution in original post

6 REPLIES 6
Super User
Super User

Re: browsegallery item color change with toggle in detail screen

Hi!

 

Are you referencing not the current gallery item somewhere? ThisItem.DataCardValue...

 

Seems like you'r referencig the same control for all the records, and in that case it will change the color of all records too.

Edwardm
Level: Powered On

Re: browsegallery item color change with toggle in detail screen

Thanks, I did mess around with thisitem, and I had to use this to get it working. It reference the name of the toggle column in my list, and not the datacardvalue.

 

If(ThisItem.Available=true; Green; Red)

View solution in original post

bishoy
Level: Powered On

Re: browsegallery item color change with toggle in detail screen

Hi ,

 

in my case i have gallery and detail screen one of the card value is the status ( Stock - Active - retired ) its drop down menu

 

so let’s say the column name is status and the card name is carddatavalue1 

how i can change the color for each status ( Red - Green - Yellow ) ?

 

i tried 

 

If(status.Value=”Stock″, Red, If(status.Value=”Active″, Yellow, If(status.Value=”Retired″, Green, Black)))

 

but now working.

Anonymous
Not applicable

Re: browsegallery item color change with toggle in detail screen

Hi @bishoy

 

Do you want the color in the details screen or on the gallery?

 

To have it on the gallery put the following function into Fill (to color the backroung) or Color (to color the text):

Switch(
  ThisItem.Status.Value,
  "Stock",Red,
  "Active",Yellow,
  "Retired",Green
)

If you want collor in the details screen add this:

Switch(
  Gallery.Selected.Status.Value,
  "Stock",Red,
  "Active",Yellow,
  "Retired",Green
)

If it does not work please make a screenshot of your setup with the error visible.

bishoy
Level: Powered On

Re: browsegallery item color change with toggle in detail screen

@Anonymous

 

Working fine, thanks

bishoy
Level: Powered On

Re: browsegallery item color change with toggle in detail screen

@Anonymous

 

 same case but i need to apply text depend on today date from the form view and gallery 

 

like : 

 

Text ( Valid , Expired) depends on date 

Helpful resources

Announcements
thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

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