cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alois
Helper III
Helper III

Conditional Visibility based on User Selected Item

Hi All,

I have a gallery of items that OnSelect leads to a detailed information screen that allows users to accept the item. Upon acceptance, the status of the item will change from 'Undelivered' to 'In Progress'. When this happens, the gallery of items visibility will be hidden from the user. The code is shown below. While my intent is to hide from the current user. The outcome is that it hides for all users! How do I isolate the visibility of the gallery items to each user's actions?

Alois_0-1603813865848.png
Thanks in advance!

Alois

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Krishna98
Helper V
Helper V

Hi @Alois ,

 

i guess you can do something like this,

in the visible property of item

ThisItem.status.value = "In Progress" && ThisItem.'Modified By'.Email = User().Email

View solution in original post

v-yutliu-msft
Community Support
Community Support

Hi @Alois ,

Do you want to hide some items only for current user?

Could you tell me the details of the hiding rule?

Do you have a column with email value and if someone accept activity, this field will update with the person who accept the activity?

Or do you want to hide the accepted activities temporarily when been accepted?

Firstly, I suggest you use Filter function to filter items based on different situations, not set gallery's Visible which will hide the whole gallery.

 

1)In first situation, you could set gallery's Items like this:

 

Filter(tablename,Not(status.value = "In Progress" ,'Modified By'.Email = User().Email))

 

 

2)In second situation, you could set like this:

set the accept button's OnSelect:

 

Collect(accepteditems,ThisItem.ID)

 

set the gallery's Items:

 

Filter(tablename,Not(ID in accepteditems.ID))

 

 

 

 

Best regards,

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

2 REPLIES 2
Krishna98
Helper V
Helper V

Hi @Alois ,

 

i guess you can do something like this,

in the visible property of item

ThisItem.status.value = "In Progress" && ThisItem.'Modified By'.Email = User().Email

View solution in original post

v-yutliu-msft
Community Support
Community Support

Hi @Alois ,

Do you want to hide some items only for current user?

Could you tell me the details of the hiding rule?

Do you have a column with email value and if someone accept activity, this field will update with the person who accept the activity?

Or do you want to hide the accepted activities temporarily when been accepted?

Firstly, I suggest you use Filter function to filter items based on different situations, not set gallery's Visible which will hide the whole gallery.

 

1)In first situation, you could set gallery's Items like this:

 

Filter(tablename,Not(status.value = "In Progress" ,'Modified By'.Email = User().Email))

 

 

2)In second situation, you could set like this:

set the accept button's OnSelect:

 

Collect(accepteditems,ThisItem.ID)

 

set the gallery's Items:

 

Filter(tablename,Not(ID in accepteditems.ID))

 

 

 

 

Best regards,

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (71,424)