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

Slowness of Look up function

Hi all, I have a problem with a duration of LookUp function and hope someone can help.
There's a requirement to get users' name in local language
1. I use Office365 Users connection to get current users' Mail
2. I have a table with two columns - Email and User Full Name (in Russian)
3. I need to find related Full Name in this table by users' email
I've tried both Excel file and SharePoint list connections, but both proceed too slowly - more than 5 minutes till the result is calculated.
There are 2500 rows in a datasource. This is pretty big but I used to proceed larger datasets much faster in other Apps.
Could anyone share any advice on how to workaround such a requirement?
Thanks in advance for your help!

1 ACCEPTED SOLUTION

Accepted Solutions

Ok,

 

So first thing - on your App OnStart, have it write the russian email address to a global variable so that it's not looking that up every time the LookUp is performed:

 

App.OnStart = Set(EmailRus, ПользователиOffice365.MyProfile().Mail)

 

Then your lookup should use that variable which is now static:

LookUp(UserNamesRu;'Employee Email' = EmailRus;'Employee Name (rus) ')

 

Let me know if this helps at all,

 

Cheers,

ManCat

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

6 REPLIES 6
iAm_ManCat
Super User
Super User

Hi,

 

Could you share the formula you are using to do the lookUp, as I feel like this will be dependant on many factors, including how the query was written and what speed connection you are on.

 

To get the current logged in user's email address, you don't need to use the Office365 users connector as there is already an internal PowerApps function - User() - that provides this:

User().Email

 

Cheers,

Mancat

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Thanks for your reply.

Queries attempted:

 

First(Filter(UserNamesRu;'Employee Email' = ПользователиOffice365.MyProfile().UserPrincipalName)).'Employee Name (rus) '

LookUp(UserNamesRu;'Employee Email' = ПользователиOffice365.MyProfile().Mail;'Employee Name (rus) '))

And several variations of those. 

 

The use-case is to fetch the russian names as User() will fetch the english names as is the default language in our active directory

 

 

Anonymous
Not applicable

Hi,

 

Thank you for your reply, I'll check internal PowerApps formula also, but guess that the problem is in the datasource for looking up into. The actual formula is - LookUp(UserNamesRu; 'Employee Email' = ПользователиOffice365.MyProfile().Mail; 'Employee Name (rus) '))

UserNamesRu - the SP list with 2 columns. First is checked for matching the user mail. Already tried Excel table from a local file

Another formula I've tried is - First(Filter(UserNamesRu;'Employee Email' = ПользователиOffice365.MyProfile().Mail)).'Employee Name (rus) '

 

Both cases work too long, list contains 2,5 K rows

Ok,

 

So first thing - on your App OnStart, have it write the russian email address to a global variable so that it's not looking that up every time the LookUp is performed:

 

App.OnStart = Set(EmailRus, ПользователиOffice365.MyProfile().Mail)

 

Then your lookup should use that variable which is now static:

LookUp(UserNamesRu;'Employee Email' = EmailRus;'Employee Name (rus) ')

 

Let me know if this helps at all,

 

Cheers,

ManCat

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Anonymous
Not applicable

Hi, ManCat

 

Thank you so much! This really helped. Now it works brilliantly fast.

 

@ankitadasgupta , thank you very much too for helping with this issue!

You're both welcome, glad to help!

 

Please mark my reply as solution if you believe it resolved the issue for you 🙂

 

Thanks,

ManCat

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,507)