cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Antonioclk
Helper IV
Helper IV

Error when changing a value inside an if - Behavior function in a non-behavior property

Hello

I have N variables set on true inside my OnStart of the application. Those variables set the visibility of certain icons.

 

inside one screen i have a list, i want to change the status of those variables based on a condition of my list but i get this mistake.

 

this is my code

If(CountRows(Filter(UserList.AllItems,Find("Manager",Role)))<1, Set(Manag_visible,true), Set(Manag_visible,false))

what am i doing wrong?

how can i set the variable on true or false based on my condition?

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Antonioclk ,

 

Set is s behavior function as you know. Behavior functions can only used in behavior properties. So, please move the formula OnVisible of that screen, replace UserList.AllItems with the source list:

If(CountRows(Filter(UserList,Find("Manager",Role)))<1, Set(Manag_visible,true), Set(Manag_visible,false))

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-jefferni
Community Support
Community Support

Hi @Antonioclk ,

 

Set is s behavior function as you know. Behavior functions can only used in behavior properties. So, please move the formula OnVisible of that screen, replace UserList.AllItems with the source list:

If(CountRows(Filter(UserList,Find("Manager",Role)))<1, Set(Manag_visible,true), Set(Manag_visible,false))

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

great 🙂 thanks

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,597)