cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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
BitLord69
Power Participant
Power Participant

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.

Anonymous
Not applicable

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

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

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.

@Anonymous

 

Working fine, thanks

@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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,354)