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

PowerApps filter on Lookup column from SharePoint

Hello all,

I'm using two lists on my SharePoint: 

 

Team Members, where I have the Name column and Status Column that can be Active or Inactive.

and the

Document Management, where I have the Document Name and Owner (lookup from Team Members column)

 

I have a PowerApps form and I'm trying to filter the Choice field to show only Active Team Memebrs, I have the follwing formula on my Owner field on Items property:

 

Filter(

    Choices('Document Management'.Owner),

    Value in Filter('Team Members', Status.Value = "Active").Name

 

But I'm not sure why when I write this down it seems PowerApps does not recognize 'Team Members' as a list and I cannot complete this filter (when I start typing 'Team... it does not appear as I type 'Document Management'):

 

unnamed.png

 

I'm sorry if this is a obvious thing that I'm missing. I started using PowerApps recently.

 

Thanks in advance for your time and support!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: PowerApps filter on Lookup column from SharePoint

@vinimedina91 

So, this may seem like a basic question, but have you actually added the Team Members datasource to your app?  Is it in the list of datasources?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

11 REPLIES 11
Highlighted
Super User III
Super User III

Re: PowerApps filter on Lookup column from SharePoint

@vinimedina91 

So, what is Owner column in the Document Management list?  Text, People, or Choice?

Is Name in the other list a text column?

 

Also, your formula does not close out the Filter statement with a closing parenthesis. 

 

 

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Frequent Visitor

Re: PowerApps filter on Lookup column from SharePoint

Hello @RandyHayes,

 

First of all, thanks for your time!

 

I've also tried adding the missing ) and got the same situation. Seems Team Members is not being recognized on the formula.

Filter(

    Choices('Document Management'.Owner),

    Value in Filter('Team Members', Status.Value = "Active").Name

)

 

Below you can find the details of my two SharePoint lists:

 

Team Members

Name: Single Line of Text

Status: Choice (Active;Inactive)

 

Document Management

Name of Document: Single Line of Text.

Owner: Lookup on Name from Team Members (it's showing as Choice, so I can pick one name).

 

I could delete the name of people on Team Members if they leave, but we want to keep track of them. We use other similar lists where we have to select the person. So if this works for document management, it might work for the others as well.

Highlighted
Super User III
Super User III

Re: PowerApps filter on Lookup column from SharePoint

@vinimedina91 

Sorry to take so long.  I wanted to duplicate your setup and make sure that I wasn't leading you the wrong way.

So, I have a List called DocumentManagement with a Text column and a Lookup Column that looks up to another list called TeamMembers, which has a Text column and a Status Choice column with Active and Inactive.  Pretty much exactly what you have.

I threw a couple names in and set some active some inactive.  Put some items in my DocumentManagement list and associated names. All is good.

 

Put a form on a screen set to the DocumentManagment datasource.  Altered the combobox in the form to set its Items property to:   Filter(Choices(DocumentManagement.Owner), Value in Filter(TeamMembers, Status.Value = "Active").Title)

Note I was lazy and just used the Title column, but it would be the same otherwise if I had called it "Name".

 

The ComboBox performed exactly as expected.

 

So where do we go from here?  Let's get specific. 

1) Choice column only allows one choice to be selected and does not allow write-in values - yours?

2) The Lookup column only allows one choice to be selected - yours?

 

See if any of this opens up some thoughts on what you have and let's take it from there.

 

 

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Frequent Visitor

Re: PowerApps filter on Lookup column from SharePoint

Hi @RandyHayes,

 

Thanks again for the feedaback and sorry for my delay.

 

So here we go:

 

1) Choice column only allows one choice to be selected and does not allow write-in values - yours?

My Choice ('Owner') in DocumentManagement (which is a lookup from TeamMembers column 'Name') can only select one value and does not allow write-in.

 

2) The Lookup column only allows one choice to be selected - yours?

The lookup only allows only one value to be selected.

 

Additional information that could help us (maybe?).

 

With this lookup I'm using the 'Add a column to show each of these additional fields:' feature to bring another value from this lookup.

 

The Name in TeamMembers ia actually an email (but using single line of text column). So we have vinicius.medina@ourdomain.com in the Name (from TeamMemebrs) and on the Owner (Choice, lookup from Name).

 

Sorry if I was not so clear in any of my explanations. English is not my native language. 

 

Let me know if you need further details!

Highlighted
Super User III
Super User III

Re: PowerApps filter on Lookup column from SharePoint

@vinimedina91 

The additional fields should not be an issue (that I know of).

 

Let's do this as a quick test - put a Button on your screen and set the OnSelect action to:

ClearCollect(colTest1, Choices(DocumentManagment.Owner));
ClearCollect(colTest2, Filter(TeamMembers, Status.Value = "Active"));
ClearCollect(colTest3, Filter(Choices(DocumentManagement.Owner), Value in Filter(TeamMembers, Status="Active").Name))

Alt-Click on the button and then go to View->Collections and look at the contents of those collections.  First see if you see results in all of them.  If not, see if there is a column misnaming or something that does not corelate properly, especially as it regards the third collection.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Frequent Visitor

Re: PowerApps filter on Lookup column from SharePoint

Hello @RandyHayes ,

 

Sorry for my delay.

 

I tried and it didn't work (not sure if I'm doing something wrong) but is seems PowerApps it's not recognizing Team Members as a list.

 

Please take a look on the snips below:

 

It seems it's an invalid argument:

error 1.png

 

I tried as TeamMembers and 'Team Members' and got the same result.

 

As you can see on below image, when I start typing Document the list is already there for me to select:

docmgmt.png

 

But when I do the same for Team Members, nothing is displayed:

team.png

 

Maybe that's why is not working for me? Can be a syntax error due to my region?

Highlighted
Super User III
Super User III

Re: PowerApps filter on Lookup column from SharePoint

@vinimedina91 

You have a space between Team and Members.  Change those to 'Team Members'

The autocomplete should recognize, as well, if you start with 'Team...

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Frequent Visitor

Re: PowerApps filter on Lookup column from SharePoint

Hi @RandyHayes ,

 

I tried using 'Team Members' and it didn't work as well:

unnamed (1).png

 

Even if I type it alone, it does not find Team Members at all:

unnamed (2).png

 

This is the snip from Document Management List (column Owner). Just to make sure I'm using lookup from Team Members:

unnamed (3).png

Highlighted
Super User III
Super User III

Re: PowerApps filter on Lookup column from SharePoint

@vinimedina91 

So, this may seem like a basic question, but have you actually added the Team Members datasource to your app?  Is it in the list of datasources?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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