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 the selections ...
Power Apps
Answered

Filter the selections on a SP list lookup field

(0) ShareShare
ReportReport
Posted on by 191

I have a canvas app that is based on a SP list (premList), one of the fields on this list is a lookup to another list (employList), in this employList is a field called role.  In my app I have a form and would like a dropdown for this lookup to only show selections where role="new". 

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

    HI @CiaranCampbell ,

    You did not say what you were filtering - if employlist

    Filter(
     employlist,
     role = "new"
    )

    and if premlist

    Filter(
     premlist,
     YourLookupField.Value = "new"
    )

     

    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

     

     

  • senna Profile Picture
    191 on at

    Thanks @WarrenBelz , sorry for not making it clearer.

    The form is premList and on that form is a dropdown which is a lookup field to the employList, so i am filtering the employList by their role returned via a lookup field dropdown.

     

    Currently in the items field for the dropdown is this;

     

    items=Choices([@premList].'Assigned To')

    I was thinking i need something like this;

    Filter(Choices([@premList].'Assigned To'), employList.Role = "New")

     

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

    Hi @CiaranCampbell ,

    A bit unclear here - if 'Assigned To' in premList is a Lookup to Role in employList and you only want the choices from the lookup where the Role is "new" then the only value you will get back is what you already know ("new")

  • senna Profile Picture
    191 on at

    Apologizes @WarrenBelz, I'm not good at explaining.  

    The dropdown is a look up to items on that employList , the dropdown currently displays the title of the employList record and the user can select which item from the employList  is relevant to them.

     

    employList 

    TitleRole
    JoeNew
    MarkOld
    PeterNew

     

    premList

    titleAssigned To (lookup to employList)ID
    Company AJoe2534
    Company BMark980567
    Company CPeter123421

     

    Form 1

    TitleTextField1
    Assigned To Dropdown1
    IDTextField2

    My items field for Dropdown1 is below

    Choices([@premList].'Assigned To')

    It would display Joe, Mark and Peter but i would like to filter it so it would only show Joe and Peter as they have the role of new in the employList 

     

    Thank you for your help so far, it is really appreciated 

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

    @CiaranCampbell ,

    If you throw away that lookup column (not the best tool in the shed for Power Apps), you can get the Items in the Combo Box with this

    Filter(
     empList,
     Role = "New"
    ).Title

     

    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

  • senna Profile Picture
    191 on at

    Thats Brilliant @WarrenBelz 

    Hopefully my last question, how do i get the field to accept the value from the combo box now instead of the dropdown.  I tired deleting the dropdown and renaming the combo as the dropdown.  I also tried to change the  field "update" to 

    Concat(comboBoxUsers.SelectedItems, Title.Value) 

  • Verified answer
    WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @CiaranCampbell ,

    That is one of the (many) problems with SharePoint Lookup fields (I simply do not use them) - writing back to them when you change the Items of a Combo Box they are attached to. You would need to do the following

    DefaultSelectedItems

    {Title: ThisItem.YourLookupFieldName.Value}

    Data Card Update

    {
     Value: YourComboBoxName.Selected.Title,
     Id: 
     LookUp(
     empList,
     Title = YourComboBoxName.Selected.Title
     ).ID
    }

    Note the different Case of ID / Id

     

    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

     

  • senna Profile Picture
    191 on at

    @WarrenBelz , What DefaultSelectedItems does that go into?

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

    @CiaranCampbell ,

    Of the Combo Box (I assume your control is one of these)

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard