cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Unbihexium
Level: Powered On

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
jhall
Level 8

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
jhall
Level 8

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)?

Unbihexium
Level: Powered On

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

jhall
Level 8

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.

jhall
Level 8

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

Unbihexium
Level: Powered On

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

jhall
Level 8

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.  Smiley Wink

Unbihexium
Level: Powered On

Re: Filter by current user and other needs

hahaha Smiley LOL 
good one! 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 73 members 3,515 guests
Please welcome our newest community members: