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

Re: Filtering records with current user

Hi @v-micsh-msft

 

I used other Logic. I added one Label and set It's  Text property to: 

LookUp( Users , internalemailaddress=Office365Users.MyProfile().Mail ,systemuserid ) 

and then on items property of Gallery to:

SortByColumns(Search(Filter('Expense Entries' , _createdby_value =  Label3.Text), TextSearchBox1.Text, "cf_comments"), "createdon", If(SortDescending1, Ascending,Descending))

It is working correctly and giving me results but with that same warning.

 

Regards, 

Vaishali

Highlighted
JRaasumaa
Level 10

Re: Filtering records with current user


@vaishalivyas1 wrote:

Hi,

 

I want to filter records on my browse screen with email of current user.I used Office 365 Users Connection. 

Logic Which I have written on items property of browse screen:

Screenshot_5.png

 


 

 

I'm surprised nobody has said this but calling User() in a function is incredibly slow performance wise. If you can, assign the User() to a variable before you use the filtering you will get better performance.

 

For example: On Visible on our Home screen (the first screen the App loads) we have the current user stored in a variable CurrentUser

 

Set(CurrentUser, User())

Then when needed you can perform a lookup on that specific user without calling the User() function by doing things like:

 

If(CurrentUser.FullName = "John Smith", true,false)

 

This helped us speed up all our filtering and added a layer of protecting controls simply by capturing the user once and then referring to the variable throughout the app.

vaishalivyas1
Level: Powered On

Re: Filtering records with current user

Hi @JRaasumaa

 

Thanks for replying , I removed that Part of code now I am not using user function anymore.

 

Regards,

Vaishali

jvargas
Level: Powered On

Re: Filtering records with current user

Thanks! For me that´s the Solution to this problem mentioned. 

Anonymous
Not applicable

Re: Filtering records with current user

I am working on a Dynamics365 Canvas App and trying to show the data by current user.

Scenario

I have created a drop down list for Open, Qualified, Disqualified and My Open Leads. By using the following formula, eveything is working fine except My Open Leads.

 

SortByColumns(Search(Filter(Leads,If(LeadDropDown.SelectedText.Value="Open Leads",_statecode_label="Open",LeadDropDown.SelectedText.Value="Disqualified Leads",_statecode_label="Disqualified",LeadDropDown.SelectedText.Value="All Leads",(_statecode_label="Open"||_statecode_label="Disqualified"||_statecode_label="Qualified"))),TextSearchBox_Lead.Text,"subject"),"subject",If(SortDescending1,Descending,Ascending))

 

I tried the instructions on the blog by but this is not working for me.

https://www.cloudfronts.com/filter-records-in-powerapps-based-on-the-current-user-of-dynamics-crm/#c...

 

What is the best method for filtering the data by current user? I can get the Onwerid/Username but I do not know how to incorporate this in the formula. Any help on this will be greatly appreciated. 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 288 members 5,288 guests
Please welcome our newest community members: