Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Random misbehavior when filtering by User().FullName

(0) ShareShare
ReportReport
Posted on by 14
Dear experts,

I have a Sharepoint form that has been modified in PowerApps.
It has a gallery with three different filtering options, one of them being by logged in user, i.e. Agent=User().FullName.
 
It has been working just fine for years, but all of a sudden, the User().FullName feature has stopped working for some of my users. The gallery returns empty. It's like the app doesn't recognize who is logged in. Some users are effected, not all! Remaining filtering options remain fine for all users.
 
My formula does have a delegation warning, but if this is the problem, shouldn't it affect all users?
 
It's this chunk of the formula:
&&If(Filterbuttons.Selected.Value="Mine";Agent.DisplayName = User().FullName;Agent.DisplayName<>"")
 
 
Any ideas, please?
  • TigerLily Profile Picture
    TigerLily 14 on at
    Random misbehavior when filtering by User().FullName
     
    Delegation warning remains, but my users are now able to filter by own name.
    You have been very helpful! 
     
  • WarrenBelz Profile Picture
    WarrenBelz 145,508 on at
    Random misbehavior when filtering by User().FullName
    I do not think User().FullName is the issue - I use it in every app I write, but try this first
    With(
       {_Name: 'Office365-användare'.MyProfile().DisplayName};
       Sort(
          Filter(
             TicketList;
             (
                (
                   Filterbuttons.Selected.Value= "Mine" &&
                   (
                      Agent.DisplayName = _Name ||
                      Assist.DisplayName = _Name
                   )
                ) ||      
                (
                   Filterbuttons.Selected.Value = "All" &&
                   !IsBlank(Agent.DisplayName)
                ) ||
                (
                   Filterbuttons.Selected.Value = "New" &&
                   Agent.DisplayName = Blank()
                ) 
             ) &&
             (
                FindTicketId.Text in Text(ID) ||
                FindTicketId.Text in Agent.DisplayName ||
                FindTicketId.Text in Title
             )
          )
       );
       TicketStatus.Value;
       SortOrder.Ascending
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     
  • TigerLily Profile Picture
    TigerLily 14 on at
    Random misbehavior when filtering by User().FullName
     
    To explain further:
    There are three filter buttons (ALL, MINE and NEW) and also a free-text search field.
    All work fine, except for the MINE filtering (for some users, not all).
     
    The data row limit in the app is set to 1000 and the current number of posts in the list is approx. 600.
     
    I know my rookie code might be horribly inefficient, but it did serve its purpose untill recently:


    Sort(Filter(TicketList;FindTicketId.Text in ID &Agent.DisplayName&Title &&If(Filterbuttons.Selected.Value="All";Agent.DisplayName<>"";Agent.DisplayName<>"")&& If(Filterbuttons.Selected.Value="New";Agent.DisplayName =Blank();Agent.DisplayName<>"")&&If(Filterbuttons.Selected.Value="Mine";Agent.DisplayName= 'Office365-användare'.MyProfile().DisplayName Or Assist.DisplayName= 'Office365-användare'.MyProfile().DisplayName;Agent.DisplayName<>""));TicketStatus.Value;SortOrder.Ascending)

    The above code is the current one, after applying suggested changes by
    mmbr1606 .

    Please note, if you have any suggestions, you would need to post the full code chain as I'm not very experienced.

    /Forever grateful



     
  • TigerLily Profile Picture
    TigerLily 14 on at
    Random misbehavior when filtering by User().FullName
    mmbr1606 

    Many thanks for your effort.
    Tried your suggestion, problem remains. :(
     
    Kind regards
     
  • mmbr1606 Profile Picture
    mmbr1606 10,448 on at
    Random misbehavior when filtering by User().FullName
    hey
     
     
     
    instead of user().FullName can u try the following:
     
    && If(Filterbuttons.Selected.Value = "Mine", Agent.DisplayName = Office365Users.MyProfile().DisplayName, Agent.DisplayName <> "")
    
     
     
     
    you would need to connect the office 365  users connector to your app.
     
     
     
     
     
    if it worked please mark as verifies answer,
     
     
     
     
     
    cheers
  • WarrenBelz Profile Picture
    WarrenBelz 145,508 on at
    Random misbehavior when filtering by User().FullName
    Your Delegation issue is here
    Agent.DisplayName <> ""
    the Not expression is not Delegable. Also you have not supplied the full filter code, so also the If() statement inside may not be Delegable
    I suspect the issue is that your record numbers are now over your Data Row Limit. Please post the full code.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard