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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Show Gallery items of ...
Power Apps
Unanswered

Show Gallery items of the User Logged from SharePoint List while a pulldown (CHOICE Field) is active on the landing page

(0) ShareShare
ReportReport
Posted on by 12

I have the following code in my ITEMS field for my Gallery, but on any user logged in, I want to only show the items they submitted and I am not sure on the syntax for this in addition to the code below. The pulldown (CHOICE Field) is only available for certain Admin users. So all other user need to see their items from the SharePoint List that they submitted and only be able to submit a new record, which I have a button for that and it works fine.

 

If(Dropdown2.Selected.Value="Leticia Lamarque",SortByColumns(Filter('Contract Review', 'Assigned To'.Value= "Leticia Lamarque"),"Created",Descending), If(Dropdown2.Selected.Value="Yasaman Moazami-Goudarzi",SortByColumns(Filter('Contract Review', 'Assigned To'.Value= "Yasaman Moazami-Goudarzi"),"Created",Descending), If(Dropdown2.Selected.Value="Pending", SortByColumns(Filter('Contract Review', 'Assigned To'.Value="Pending"),"Created",Descending), Filter('Contract Review', 'Created By'.DisplayName=User().FullName))))

 

Categories:
  • SoPatt Profile Picture
    Microsoft Employee on at

    Here is your code in a readable form:

    If(
     Dropdown2.Selected.Value="Leticia Lamarque",
     SortByColumns(
     Filter('Contract Review', 'Assigned To'.Value= "Leticia Lamarque"),
     "Created",
     Descending
     )
    ,//Else
     If(Dropdown2.Selected.Value="Yasaman Moazami-Goudarzi",
     SortByColumns(
     Filter('Contract Review', 'Assigned To'.Value= "Yasaman Moazami-Goudarzi"),
     "Created",
     Descending
     )
     ,//Else
     If(Dropdown2.Selected.Value="Pending", 
     SortByColumns(Filter('Contract Review', 'Assigned To'.Value="Pending"),
     "Created",
     Descending
     )
     ,//Else
     Filter('Contract Review', 'Created By'.DisplayName=User().FullName)
     )
     )
    )

    Here is your code as a Switch, which I think is even more readable:

    Switch(
     Dropdown2.Selected.Value,
     "Leticia Lamarque",
     SortByColumns(
     Filter('Contract Review', 'Assigned To'.Value= "Leticia Lamarque"),
     "Created",
     Descending
     ),
     "Yasaman Moazami-Goudarzi",
     SortByColumns(
     Filter('Contract Review', 'Assigned To'.Value= "Yasaman Moazami-Goudarzi"),
     "Created",
     Descending
     ),
     "Pending", 
     SortByColumns(Filter('Contract Review', 'Assigned To'.Value="Pending"),
     "Created",
     Descending
     ),
     Filter('Contract Review', 'Created By'.DisplayName=User().FullName)
    )


    I'm not exactly sure what isn't working for you.

  • ramoroso Profile Picture
    12 on at

    Thank you sopatte - much more readable. I will try to start writing my code in this format, as I see this is the standard.

  • ramoroso Profile Picture
    12 on at

    Hello sopatte - What is not working, or I am not sure how to do it in conjunction with my pulldone, is I want the gallery to only shows selected records that were input from the logged in user. Yet right now it shows all records depending what the pulldown is set at upon login. Does that help ? I need this initial view (only records submitted by current logged in user) in conjunction, with my If statement.

  • SoPatt Profile Picture
    Microsoft Employee on at

    I'm still not clear, but might it be that you want Dropdown2's Default to be "Pending"? Then the gallery will be filtered by 'Created By'.DisplayName=User().FullName.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard