cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Filter by current user and other needs

Hello 

 

I would like to add filter for defined user which are stored in a excel.
The following does not work and I can not figure out how to do it correctly.
Does anyone have an idea how else can this be achieved? (see screenshot)

 

//Filter für User --> Works perfekt
If(type="Alle";Filter('Erfassung und Freigabe neuer Artikel 2'; Author.DisplayName = User().FullName );
If(type="Offene";Filter('Erfassung und Freigabe neuer Artikel 2'; Author.DisplayName = User().FullName &&
Status = "Neu" || Status = "Offen" );
If(type="Erledigte";Filter('Erfassung und Freigabe neuer Artikel 2'; Author.DisplayName = User().FullName &&
Status = "Erledigt");

 

//Visoren Filter
//Filter für Verifizierer
If(User().FullName in Tabelle5; <--- Problem is here, does not work ---> A excel Sheet table where defined who should see the items
If(type="In arbeit";
Filter('Erfassung und Freigabe neuer Artikel 2';Status="Neu"))))))

 

What I have tried as well with no success:
If(User().FullName in Tabelle5 && type="In Arbeit";...... or

If(type="In Arbeit && User().FullName in Tabelle5; ...... or

If(type="In arbeit";
If(User().FullName in Tabelle5;.........

 

Please help

 

regards

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Continued Contributor
Continued Contributor

Re: Filter by current user and other needs

I did do a quick proof of concept for you.  So take an Excel list similar to yours:

 

image.png

Import the table into the PowerApps (e.g. Table1)

Create a button and set it's Text field to: If(IsEmpty(Filter(Table1,Pr0fer="Tom")),"Not Found","Found")

Alternatively, same as above except use: If("Tom" in Table1.Pr0fer,"Found","Not Found")

Both result in the button text being "Found".

What I'm betting here is that you left off the column designation: Table1.Pr0fer.  You need to tell the "in" function which column to be looking for the data in.  

View solution in original post

7 REPLIES 7
Highlighted
Continued Contributor
Continued Contributor

Re: Filter by current user and other needs

You could try the LookUp() or Filter() functions vs. In (which could be where things are strange).  Lookup/Filter is a little more widely used within PowerApps IMHO so better testing/results for the most part.  

 

For example: IsEmpty(Filter(Tabelle5,Name=User().FullName))

 

Also, it isn't obvious but are your two working/non-working examples accessing the same data source (an Excel sheet)?

Highlighted
Helper II
Helper II

Re: Filter by current user and other needs

Hi jhall

 

Thanks for your reply

 

Actually yes, I've only one Excel sheet where everything is deposited but the data that I want to filter comes from a SharePoint List --> ('Erfassung und Freigabe neuer Artikel 2')

In the Excel Sheet is stored which users are "super visors" and the filter names and gallery names.
As soon as I delete the part 
"If(User().FullName in Tabelle5;"  (see screen shot)  it works... but I need to display these things for different users.

for testing I've put my name to the table (Tabelle5) and thought it will work.

 

I want that PowerApps is checking the current user (all are office365 users) and if the user is found in the excel sheet "Tabelle5" it have to show these specific items (which are stored in the SharePoint list).

 

Unfortunately I don't know how this can be done by LookUp or Filter function... I've tried and searched for hours but nothing seems works.

 

Best regards

Highlighted
Continued Contributor
Continued Contributor

Re: Filter by current user and other needs

Sorry if I'm getting off-topic here, but just one more clarification, you're importing this Excel document as static data, correct? ( View | Data Sources | Add Data Source | Import from Excel)

image.png

You're aware that this won't necessarily stay up to date?  Meaning that changes to the Excel document going forward won't replicate to your application unless you manually perform this update.

Highlighted
Continued Contributor
Continued Contributor

Re: Filter by current user and other needs

I did do a quick proof of concept for you.  So take an Excel list similar to yours:

 

image.png

Import the table into the PowerApps (e.g. Table1)

Create a button and set it's Text field to: If(IsEmpty(Filter(Table1,Pr0fer="Tom")),"Not Found","Found")

Alternatively, same as above except use: If("Tom" in Table1.Pr0fer,"Found","Not Found")

Both result in the button text being "Found".

What I'm betting here is that you left off the column designation: Table1.Pr0fer.  You need to tell the "in" function which column to be looking for the data in.  

View solution in original post

Highlighted
Helper II
Helper II

Re: Filter by current user and other needs

OMG I'm so blind! 

If(User().FullName in Tabelle5.Prüfer;

Thats the mistake I've made. Now it works!
jhall Thank you so much!!!!

 

I can't believe it... I shame myself! LoL

Thanks for your efforts m8!!

Best regards

Highlighted
Continued Contributor
Continued Contributor

Re: Filter by current user and other needs

My license plate (and personal email) is "IQof20".  It is a reminder that at least once per day I am a total moron.  😉

Highlighted
Helper II
Helper II

Re: Filter by current user and other needs

hahaha Smiley LOL 
good one! 

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,950)