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

Filter using user email address - User().Email (Delegation problem)

I am new to power apps and i am trying lo launch my first app at my company. I have a delegation problem with a filter: (i have 600 records and have change the configuration of the app to admit 1000)

 

SortByColumns( Filter( 'mylist'; StartsWith(Nombre1; TextSearchBox1.Text); User().Email=CDF); "Nombre1"; If(SortDescending1; Descending; Ascending))

 

It takes ages to wok on the mobile and i cant find the way to workaround it. I am working with a sharepoint list with a column called "CDF" where i store the email of the user I am trying to filter the gallery so user can also see their information (i am the owner of all the entries)

 

I have tried to store onstart on a global variable the info but then the filters doesnt work (i dont know if this could help)

 

PLEASE HELP

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filter using user email address - User().Email (Delegation problem)

Hi @miponte,

 

Could you please share a bit more about your app's configuration?

 

I have made a test on my side and don't have the issue that you mentioned. Please check if the vble variable (global variable) that you defined within your app contains a valid email address rather than empty.

 

If the vble variable contains a valid email address, please also check if there are some records associated with this email address within your SP list.

 

In addition, please also check if you have changed the Non-delegable limits properly within your App Settings. More details about changing the Non-delegable limits in App Settings, please reference the following GIF image:Test1.gif

 

 

You could also take a try to define a global variable within the OnVisible property of the first screen rather than OnStart property. Then check if the issue is solved.

 

Set the OnVisble property of the first screen of your app to following formula:

Set(vble,User().Email)

Set the Items property of the Gallery control to following formula:

SortByColumns(Filter('mylist',StartsWith(Nombre1,TextSearchBox1.Text),CDF=vble),"Nombre1",If(SortDescending1,Descending,Ascending))

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 REPLIES 6
mr-dang
Level 10

Re: Filter using user email address - User().Email (Delegation problem)

Hi @miponte,

It sounds like you want to Filter 'mylist', but it's hitting delegation and perf issues on mobile.

 

One small tweak you can make for now is to set the email of the current user of the app to a variable. Then you can filter the gallery against that variable. Otherwise, the app will attempt to figure out who the current user is for each row in the gallery.

 

Mr. Dang

 

_______

Microsoft Employee
@8bitclassroom
miponte
Level: Powered On

Re: Filter using user email address - User().Email (Delegation problem)

Hi @mr-dang, thanks a lot for the answer, tried with a global variable, on the first screen, property: OnStart

 

Set(vble;User().Email)

 

And then in the filter use the variable, but the gallery goes blank, filter noi working, Maybe fixing this will be the answer.

 

I then tried to give the vble the value OnHold of a button, that makes the filter work but this has no sense, users wont press the button, and all his is for securit reasons, so when user open on their mobiles, the just see their info (i am filtering with a column with their email adress)

 

I have tried with data source at Azure SQL (same problem), and excel online at Onedrive for Enterprise (here i didnt get the advice of the delegation, but when the app opens at the mobile, 30 seconds to apply the user filter, and takes ages each time i write at the filter)

 

Any ideas?

Community Support Team
Community Support Team

Re: Filter using user email address - User().Email (Delegation problem)

Hi @miponte,

 

Could you please share a bit more about your app's configuration?

 

I have made a test on my side and don't have the issue that you mentioned. Please check if the vble variable (global variable) that you defined within your app contains a valid email address rather than empty.

 

If the vble variable contains a valid email address, please also check if there are some records associated with this email address within your SP list.

 

In addition, please also check if you have changed the Non-delegable limits properly within your App Settings. More details about changing the Non-delegable limits in App Settings, please reference the following GIF image:Test1.gif

 

 

You could also take a try to define a global variable within the OnVisible property of the first screen rather than OnStart property. Then check if the issue is solved.

 

Set the OnVisble property of the first screen of your app to following formula:

Set(vble,User().Email)

Set the Items property of the Gallery control to following formula:

SortByColumns(Filter('mylist',StartsWith(Nombre1,TextSearchBox1.Text),CDF=vble),"Nombre1",If(SortDescending1,Descending,Ascending))

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
miponte
Level: Powered On

Re: Filter using user email address - User().Email (Delegation problem)

@v-xida-msft@mr-dang@Shanescows

 

I love you all guys, y-xida made me get sure the global vble was working ok, and it was not, at least in the development enviroment.

 

When i pushed it to the phone, the global vble worked with the OnStart property and start filtering really fast. (couldnt simulate that in the computer)

 

I cant tell how happy i am.

 

This will make a big change in my reporting platform at my company.

 

I will keep in touch and hope sometime i can help another.

Super User
Super User

Re: Filter using user email address - User().Email (Delegation problem)

Hi,

 

To help you out with any future work - if you create a button and then set its onSelect to the things you are doing onStart, you can press it while in Dev to simulate the onStart function (as this is not called during editing of apps, only during the App's startup when run as an App).

 

ManCat



My loving and understanding partner gives the best advice on fixing errors: "Just type in some different things".

Don't forget to Mark as Solution and Thumbs Up those who deserve it!
Highlighted
Lexnnn
Level: Powered On

Re: Filter using user email address - User().Email (Delegation problem)

This did help me to filter on User = email from people field: (I was using people field and it did not work well with powerapps) (3200+ items)
https://wonderlaura.com/2018/10/26/powerapps-filter-by-me/

Solution in short: use variable "on start" + "OnVisisble" refresh of the list and use same variable in filter +  single line of text field instead of poeple field.

SortByColumns(Filter('Sandwich shop',(Salesrepemail = CurrentUser.Email) And ((StartsWith(Account_x0020_name, TextSearchBox1.Text)) Or (StartsWith(Street, TextSearchBox1.Text)) Or (StartsWith(City, TextSearchBox1.Text))Or (StartsWith(Postal_x0020_Code, TextSearchBox1.Text)))), "Account_x0020_name", If(SortDescending1, Descending, Ascending))

 

To let the users still be able to use the people field, I use flow to auto populate the new single line of text field with a copy of email adress from people field.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

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

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 44 members 3,985 guests
Please welcome our newest community members: