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

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / filtering one SP list ...
Power Apps
Unanswered

filtering one SP list based off data in another SP list

(0) ShareShare
ReportReport
Posted on by

Hello, 

I'm trying to write a filter and I'm struggling with what needs to be in it.  I am looking to have the powerapp filter results of "forecast Form" based off of the "rep name" in another list called "global Accounts" and filter those results based off of the current user.  I already had the app working where it would filter the "forecast form" by "Rep Name" in the same SP list but now I'm asked to reference the "global accounts" SP list since the rep name was removed from the forecast form.  

 

Filter('Forecast form ', 'Global Accounts' = CurrentUser || 'GWA ID L/U:Region_TXT'= CurrentUser)

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    152,839 Most Valuable Professional on at
    Re: filtering one SP list based off data in another SP list

    Hi @Anonymous ,

    You cannot filter on a Lookup field. Using your syntax try this

    Filter(
     AddColumns(
     'Forecast form', 
     "aRegion",
     'GWA ID L/U:Region_TXT'
     ),
     'Global Accounts' = CurrentUser ||
     aRegion = CurrentUser
    )

     

    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.

  • Community Power Platform Member Profile Picture
    on at
    Re: filtering one SP list based off data in another SP list

    Thank you, I forgot about not being able to use lookup columns from SP.  I ended up having 2 columns added to the SP list "global accounts" one for account managers and one for sales managers so it can filter based off those 2 columns and the current user.  below is what I changed from your reply but I'm getting a invalid argument error.  

     

    Filter(AddColumns('Forecast form', "aregion", 'accountmanger_txt'), 'Global Accounts' = CurrentUser || "aregion", 'salesmanager_TXT' = CurrentUser)

  • WarrenBelz Profile Picture
    152,839 Most Valuable Professional on at
    Re: filtering one SP list based off data in another SP list

    Hi @Anonymous ,

    Your syntax is invalid in this bit

    'Global Accounts' = CurrentUser || "aregion", 'salesmanager_TXT' = CurrentUser

    If Global accounts = CurrentUser (OK), but after the Or() || statement, your have put the new column on it own without an equals argument, then salesmanager_TXT = CurrentUser (OK).

    Do you need the new column now, if so it has it equal something.

  • Community Power Platform Member Profile Picture
    on at
    Re: filtering one SP list based off data in another SP list

    I only need the new column if it's required for powerapps to filter properly.  The data is pretty much the same in "global accounts" as it is in forecast with the exception of account rep and manager's names to filter by.  I was adding the additional columns thinking that was the right way to go since it was in your previous solution.  The adding of columns and filtering by another SP list are new to me as I learn powerapps.  

  • WarrenBelz Profile Picture
    152,839 Most Valuable Professional on at
    Re: filtering one SP list based off data in another SP list

    @Anonymous 

    Yes but it I still had to equal something. Remove it and see if this gets you what you want.

  • Community Power Platform Member Profile Picture
    on at
    Re: filtering one SP list based off data in another SP list

    So something like this?

     

    Filter('Forecast form (WRFP-2)', 'Global Wireline Accounts'.displayname, = CurrentUser)
  • WarrenBelz Profile Picture
    152,839 Most Valuable Professional on at
    Re: filtering one SP list based off data in another SP list

    @Anonymous ,

    Apart from the capitalisation of display name, that is valid code, providing it references matching fields and controls.

     

    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.

  • Community Power Platform Member Profile Picture
    on at
    Re: filtering one SP list based off data in another SP list

    @WarrenBelz 

     

    I capitalized the DisplayName but I'm not getting any accounts returned when I test it along with .displayname and = are showing as invalid arguments.  Am I missing the column it should be referencing on the SP list "Global Wireline Accounts"?  The forecast form is filtered in SP based off lookup columns that look up the users from global wireline accounts SP List and I'm trying to accomplish the same in the app.  My data sources in powerapps are the 2 SP lists mentioned above and office365users.  

     

    Capture.JPG 

    Filter('Forecast form (WRFP-2)', 'Global Wireline Accounts'.DisplayName = CurrentUser)
     
     

     

  • WarrenBelz Profile Picture
    152,839 Most Valuable Professional on at
    Re: filtering one SP list based off data in another SP list

    @Anonymous ,

    I have been mainly looking at syntax to this point. I cannot see your data, so can you please summarise what field have to equal what values in what lists.

  • Community Power Platform Member Profile Picture
    on at
    Re: filtering one SP list based off data in another SP list

    @WarrenBelz  

    Sorry about that, sure thing.  

     

    I'm looking to filter "Forecast Form" data by the current user logged in and that could be a rep or the manager. The forecast form doesn't contain txt columns for the rep and manager, only lookup columns and those are looked up from the "global wireline accounts" list.  I want the app to look at the "global wireline accounts" list and filter the columns "sales manager_TXT" and "Account Manager_TXT) against the current user so that the accounts in the Forecast form are only displayed for those reps and managers that own the accounts.  In the end the rep/manager will select an account and the app will take them to the details page based off the forecast form.  From there they will then select edit and it will open an edit page so they can input the necessary forecasts and that data once saved will populate back in the "forecast Form" list of SP.  Hope this helps and make sense.   

     

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 231 Super User 2025 Season 2

Last 30 days Overall leaderboard