cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BenTalbott
Frequent Visitor

How To Filter Form Drop Down That Is A SharePoint List Lookup Column

Scratching my head on this one.....

I have a SharePoint Online list which is my data source.  I am building a canvas PowerApp on top of it.

One of my fields in the SharePoint list is a lookup field, getting information from another SharePoint Online list.

I can display this in its default state in the form no problem.

 

However, what I need to do is filter the drop down in the form based on a column in the list being looked up.

 

Main SPO List name - NIR

Main SPO List field in question - PPC

SPO List name being looked up - ItemFamily

SPO List field being displayed - PPCName

SPO List field to filter on - Display      (this is currently a text field, but can be any field type if I can get this working)

 

So in the form the drop down field currently shows all items in the lookup list.  The fields Items property is;

Choices([@NIR].PPC)

 

From what I have read, the choices function returns two columns ID & value (in this case PPCName)

Is it possible to filter this Items property so that only records where a 3rd column equals something are shown? (Display = "Yes")

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@BenTalbott 

For this, you will need to get rid of the Choices function in your formula.

You will need to Filter the looked up list directly.

 

To simulate this, you can use the following formula on the Items property formula of your DropDown:

Filter(
   ItemFamily,
   Display = "Yes"
)

This is assumed that Display is a Text Column in your ItemFamily list.

 

If you want the EXACT results as the Choice function, you can use the following formula:

RenameColumns(
    ShowColumns(
        Filter(
            ItemFamily,
            Display = "Yes"
        ),
        "ID", "PPCName"
    ),
    "ID", "Id",
    "PPCName", "Value"
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @BenTalbott ,

You can filter the DropDown Field like below - 

Filter(SharePointListName,DropDOwnField.Value="New/Pending")

VijayTailor_0-1601992156405.png

Thanks,

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay

RandyHayes
Super User
Super User

@BenTalbott 

For this, you will need to get rid of the Choices function in your formula.

You will need to Filter the looked up list directly.

 

To simulate this, you can use the following formula on the Items property formula of your DropDown:

Filter(
   ItemFamily,
   Display = "Yes"
)

This is assumed that Display is a Text Column in your ItemFamily list.

 

If you want the EXACT results as the Choice function, you can use the following formula:

RenameColumns(
    ShowColumns(
        Filter(
            ItemFamily,
            Display = "Yes"
        ),
        "ID", "PPCName"
    ),
    "ID", "Id",
    "PPCName", "Value"
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,838)