cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Saan
Helper III
Helper III

User() function not working for some users.

Hello All,

I have created a convas powerapp and in apps on start i set variables like below: Set(CurrentUser,User()); Set(currentuseremail, Lower(User().Email));

Am filtering the gallery with created by. email = User().email

like: Filter('Employee Survey', User().Email = 'Created By'.Email) this is working for most of the users and not few like 4 to 5 users. not sure why?

When i checked by hard coded like  Filter('Employee Survey',  ''Created By'.Email ="xyz.dave=domain.com") it filtered the data correctly. seems that the User() function is not working for those users.

 

Is there any solution for this? or am i doing something wrong. if it's wrong then it shouldn't work for any user i guess.

 

Any help is much appreciated, kind of little urgent, after moving to production this is the issue we found.

 

Or is there something with this: the below is the screenshot. if user won't click on allow, might be User() function not getting the details. is that the case? if so how can they go back to that screen and then hit allow. again if they open the power app they unable to see the below screen again.

Userlogin.png

 

 

Thanks,

Saan 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Drrickryp
Super User II
Super User II

Sure, for example.

Set(CurrentUser,User()); Set(currentuseremail, Lower(Trim(User().Email)));

Sometimes there are spaces in the user.email and they are not obvious looking at the value. Trim() removes them.   You may want to make sure both sides of your filter are the same case and trimmed.  I am not sure if the User.Email is case sensitive but to make sure, use Lower on both sides of the equation too.

 Filter('Employee Survey',
      Lower(
        Trim(
           User().Email
         )
        ) = 
         Lower(
           Trim(
                 'Created By'.Email
           )
         )
     ) 

View solution in original post

v-siky-msft
Community Support
Community Support

Hi @Saan ,

 

I haven't met such issue, but I think you can use Office365Users.MyProfileV2().mail function as an alternative workaround.

In addition, the Permission Tab is asking users whether  powerapps is allowed to access the sharepoint list data. As long as it is allowed, the SharePoint list data can be loaded in PowerApps.

In General, the Tab only shows at the first time. If you want the Tab show again, please try to re-share the Apps to users.

Hope this helps.

Sik

View solution in original post

5 REPLIES 5
Drrickryp
Super User II
Super User II

@Saan 

Have you tried the Trim() Function on the User name? I have found this is sometimes the reason for this observation.

@Drrickryp Can you help me on how to do trim on user name and compare the same thing with list createdby. Am new to Powerapps.

 

Saan

Drrickryp
Super User II
Super User II

Sure, for example.

Set(CurrentUser,User()); Set(currentuseremail, Lower(Trim(User().Email)));

Sometimes there are spaces in the user.email and they are not obvious looking at the value. Trim() removes them.   You may want to make sure both sides of your filter are the same case and trimmed.  I am not sure if the User.Email is case sensitive but to make sure, use Lower on both sides of the equation too.

 Filter('Employee Survey',
      Lower(
        Trim(
           User().Email
         )
        ) = 
         Lower(
           Trim(
                 'Created By'.Email
           )
         )
     ) 

View solution in original post

v-siky-msft
Community Support
Community Support

Hi @Saan ,

 

I haven't met such issue, but I think you can use Office365Users.MyProfileV2().mail function as an alternative workaround.

In addition, the Permission Tab is asking users whether  powerapps is allowed to access the sharepoint list data. As long as it is allowed, the SharePoint list data can be loaded in PowerApps.

In General, the Tab only shows at the first time. If you want the Tab show again, please try to re-share the Apps to users.

Hope this helps.

Sik

View solution in original post

jdavey1
Frequent Visitor

Hi

 

I am also having this issue. I have tried the above but they haven't fixed the issue. Any other ideas on what I could try to resolve this?


Thanks in advance

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (47,043)