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

Conditional Formatting based on finding a row in a table that meets requirements in multiple columns

Hi, 

 

I'm working on making a favorites functionality for an application. Basically I have it saving to a table when a user favorites it and I need to be able to color in a star if it's saved by the active user. I can make it color the star if any user has it as a favorite but I'm having issues with showing it colored only if the current user has it favorited. I've tried a couple things but I think this might be the closest. Basically I'm trying to filter the table by the user email first (it's associated to their record in the table) and then see if there is an item with the same title in the results. Code below:

 

If(Filter(UserFavorites,Email=User().Email) And(Search(UserFavorites,ThisItem.Title, "Title")), Pink, Blue)

 

 

With this I'm getting an error at the AND of "Expected operator" where it's looking for a mathmatic function. Any advice?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Conditional Formatting based on finding a row in a table that meets requirements in multiple columns

Hi @Newbie ,

Thse result of Filter and Search function is tables.

It's not supported to use If(table And table,...,....)

The right syntax of If statement is:

If(formula,result1,result2)   (the formula's result should be true or false)

Try this formula:

If(!IsEmpty(Filter(UserFavorites,Email=User().Email,ThisItem.Title in Title)),   
//if the item exists,the result of Filter will not be empty
Pink,
Blue)

Here's a doc about If statement for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-if

 

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Conditional Formatting based on finding a row in a table that meets requirements in multiple columns

Hi @Newbie ,

Thse result of Filter and Search function is tables.

It's not supported to use If(table And table,...,....)

The right syntax of If statement is:

If(formula,result1,result2)   (the formula's result should be true or false)

Try this formula:

If(!IsEmpty(Filter(UserFavorites,Email=User().Email,ThisItem.Title in Title)),   
//if the item exists,the result of Filter will not be empty
Pink,
Blue)

Here's a doc about If statement for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-if

 

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

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,548)