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 / Filter SharePoint base...
Power Apps
Unanswered

Filter SharePoint based on condition

(0) ShareShare
ReportReport
Posted on by 438

Screenshot 2023-12-11 at 3.33.10 PM.png

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @dylandavis09 ,

    I think this is what you are after, but not entirely clear.

    With(
     {
     _Sponsor:
     LookUp(
     'Class of 20XX (Officers)',
     'Head Sponsor' = User().FullName
     )
     },
     Sort(
     Filter(
     'DHS Student Users',
     'L-Grade' = _Sponsor.'L-Grade'
     ),
     'Student Name'
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • dylandavis09 Profile Picture
    438 on at

    Where it is come from "_Sponsor:"?

    Screenshot 2023-12-11 at 10.58.32 PM.png

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    @dylandavis09 ,

    Assuming 'Head Sponsor' is a Person field. you may also have an issue if 'Student Name' is also one of these (requires .DisplayName after it). Also I assume 'L-Grade' is a Choice column.

    With(
     {
     _Sponsor:
     LookUp(
     'Class of 20XX (Officers)',
     'Head Sponsor'.DisplayName = User().FullName
     )
     },
     Sort(
     Filter(
     'DHS Student Users',
     'L-Grade'.Value = _Sponsor.'L-Grade'.Value
     ),
     'Student Name'
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • dylandavis09 Profile Picture
    438 on at

    Hi @WarrenBelz. Okay, the 'Head Sponsor' is a text field, not a person field. Additionally, 'L-Grade' is a choice column.

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @dylandavis09 ,

    So out of that, what have you tried using the code I provided ?

  • dylandavis09 Profile Picture
    438 on at

    Let me show you screenshot. 🙂

     

    Screenshot 2023-12-12 at 11.25.12 AM.pngScreenshot 2023-12-12 at 11.22.06 AM.png

     

    But I'm wondering, where does the term '_Sponsor' come from?

    Screenshot 2023-12-12 at 11.25.12 AM.png

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    @dylandavis09 ,

    I was hoping you would work out what to change from my comments - it is simply about field types

    With(
     {
     _Sponsor:
     LookUp(
     'Class of 20XX (Officers)',
     'Head Sponsor' = User().FullName
     )
     },
     Sort(
     Filter(
     'DHS Student Users',
     'L-Grade'.Value = _Sponsor.'L-Grade'.Value
     ),
     'Student Name'
     )
    )

    _Sponsor is simply a Variable - you can call it whatever you want. I am assuming in the code above that 'L-Grade' is a single choice column in both lists and 'Head Sponsor' is a Text field matching the user's name.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • dylandavis09 Profile Picture
    438 on at

    Ok I got it! You correct that L-Grade is a single choice choice column, and Head Sponsor is a text field. It's still something error in red box. Otherwise, green box is worked. 🙂

    Screenshot 2023-12-12 at 9.35.52 PM.png

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    @dylandavis09 ,

    There is somehting wrong with one of your references as the structure is correct. There is a line under 'DHS Student Users', so maybe that is not the correct name.

  • dylandavis09 Profile Picture
    438 on at

    @WarrenBelz, I found the solution. I just added it to 'DHS Students Users' Now it's better, and no errors are displayed; we still have a warning message, though.

     

    Screenshot 2023-12-12 at 10.07.33 PM.png

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard