cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
Frequent Visitor

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

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.

Highlighted
Frequent Visitor

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

Highlighted
Helper IV
Helper IV

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.

Highlighted
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.

Highlighted
Helper IV
Helper IV

Re: browsegallery item color change with toggle in detail screen

@Anonymous

 

Working fine, thanks

Highlighted
Helper IV
Helper IV

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
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,243)