web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Visible Items in a Gal...
Power Apps
Answered

Visible Items in a Gallery

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

 

I have a Gallery (named Gallery2) that shows items from a sharepoint list (named ChangeMaster)
I would like the Gallery to only show the items that has the approvers name in either of two columns (named 1stApprover or 2ndApprover) but also the column named ChangeStatus must be set to Submitted or 1st Stage Approved. The gallery should be blank if either of these conditions are not met. Approver1 and Approver2 can have multiple names in each row, so the formula would need to be able to look at the whole or part of the field to find the users email address.

 

Hopefully that makes sense

 

Thanks in advance!

Categories:
I have the same question (0)
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @Dave-ITMan ,
    You can try using something like below on Items property of Gallery2 - 

    Filter(ChangeMaster, (User().Email in Approver1.Email || User().Email in Approver2.Email) && (ChangeStatus .Value="Submitted" || ChangeStatus .Value="Approved"))

  • Dave-ITMan Profile Picture
    on at

    Hi @NandiniBhagya20 ,

    Thanks, it's doing the first part of showing only the ones with the name in Approver1 or Approver2 but not doing the && part of only the ones showing Submitted or Approved, it's showing some blank ChangeStatus too?  

    Many thanks

  • Verified answer
    NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Filter(ChangeMaster, (User().Email in Approver1.Email || User().Email in Approver2.Email) && ((ChangeStatus .Value="Submitted" || ChangeStatus .Value="Approved") && !IsBlank(ChangeStatus .Value)

    ))

  • MVP-Phipps Profile Picture
    3,508 Super User 2024 Season 1 on at
    Filter(ChangeMaster, (User().Email in Approver1.Email || User().Email in Approver2.Email) && ((ChangeStatus .Value="Submitted" || ChangeStatus .Value="Approved") && !IsBlank(ChangeStatus .Value)))

    Try this ^

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful because this can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
    Twitter: https://twitter.com/phipps0218

  • Dave-ITMan Profile Picture
    on at

    Hi @NandiniBhagya20  and @phipps0218 

    Thanks, i've had to amend your recommended code to the below for it to not throw errors (apologies I did give some wrong names for columns originally). But i'm not seeing results in the gallery if the name is in multiple addresses for example if Approver1 has name1@domain.com;name2@domain.com it doesn't recognise that the email address is in that string. 

    Filter(ChangeMaster, (User().Email in '1stApprover' || User().Email in '2ndApprover') && ((ChangeStatus="Submitted" || ChangeStatus="Approved") && !IsBlank(ChangeStatus)))

      Thank you for your help!

  • Dave-ITMan Profile Picture
    on at

    Hi @phipps0218 and @NandiniBhagya20 

    Apologies it is working, it was me being an idiot and not changing it from Approved to 1st Stage Approved in the code. All working fine, thank you both! 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard