web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter last entry on d...
Power Apps
Answered

Filter last entry on dataverse?

(0) ShareShare
ReportReport
Posted on by 503

Hello

 

Each time a user logs in, a text record 'Yes' is created in a column next to the users ID code. So, logged in = Yes.

I am trying to filter a column in Dataverse. If the user's last entry was a 'yes' entry then the button should be disabled. 

 

 If(IsEmpty(Last(Filter('Stagings', 'Logged In'= TextInput1.Text, 'Employee Code'=inPutEmployeeID))),
 DisplayMode.Edit, 
 DisplayMode.Disabled)

 

 Right now the button is always disabled and im not sure why using the above formula (textinput1.text is displaying 'yes').  So it's filtering based on the user's code and whether or not the latest entry for that user was a 'yes' but not working. 

 

I;ve also tried : 

 If(IsEmpty(Last(Filter('Stagings', 'Logged In'= Text('Yes'), 'Employee Code'=inPutEmployeeID))),
 DisplayMode.Edit, 
 DisplayMode.Disabled)

But that says theres invalid arguments with Text('Yes')

 

Also:

 If(IsEmpty(Last(Filter('Stagings', 'Logged In'= Text('Stagings'.'Logged In'.'Yes')), 'Employee Code'=inPutEmployeeID))),
 DisplayMode.Edit, 
 DisplayMode.Disabled)

But no luck. 

 

Any help is much appreciated with this. Thank you 

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at
     If(IsEmpty(Last(Filter('Stagings', 'Logged In'= "Yes", 'Employee Code'=inPutEmployeeID))),
     DisplayMode.Edit, 
     DisplayMode.Disabled)

     

    Try that please

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

    Check my LinkedIn!

  • Ram Prakash Duraisamy Profile Picture
    5,753 Super User 2026 Season 1 on at

    Hi @Usernametwice23,

     

    Try Using below code

     

    If(IsEmpty(Last(Filter('Stagings', And('Logged In'= "Yes", 'Employee Code'=inPutEmployeeID)))),
     DisplayMode.Edit, 
     DisplayMode.Disabled)
  • Usernametwice Profile Picture
    503 on at

    Hi @Nogueira1306 

    Thank you for the comment. Its much appreciated. 

    Okay so now the button is permanently disabled if I use that one. Even if their last entry doesnt have 'yes' next to it. Is there a way to make it available again if the users last record doesnt have yes? I thought the 'last' function would do this but i guess i was wrong. 

    Thanks for your help

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at
     If(IsEmpty(First(Sort(Filter('Stagings', 'Logged In'= "Yes", 'Employee Code'=inPutEmployeeID); Created; Descending))),
     DisplayMode.Edit, 
     DisplayMode.Disabled)

     

    Please try that one. Check if syntax is correct

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

    Check my LinkedIn!

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Usernametwice23 

    IsEmpty() refers to a table but you are trying to examine a single record with Last(). IsBlank() would be more appropriate. 

     

  • Usernametwice Profile Picture
    503 on at

    Thanks @Nogueira1306

    Thats really helpful and I would not have thought of that. 

    I'm getting the expected operator message, +,* or &, Im guessing the syntax needs something here but i'm unsure what. I'm sure it's something simple but I cant see it.

     

    I saw your message said check syntax but to me it looks correct. Sorry if this is a silly question.

     

    Appreciate the help very much. 

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Show me the error

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

    Check my LinkedIn!

  • Usernametwice Profile Picture
    503 on at

    Hi @Nogueira1306 

    Attrached is a screenshot of the error 

    error1212.JPG
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at
     If(IsEmpty(First(Sort(Filter('Stagings', 'Logged In'= "Yes", 'Employee Code'=inPutEmployeeID), Created, Descending))),
     DisplayMode.Edit, 
     DisplayMode.Disabled)
  • Usernametwice Profile Picture
    503 on at

    Hi @Nogueira1306 

     

    Apologies, but when I use that I receive this error now attached. Im out of my depth here im afraid and unsure what I should remove.

     

    Thanks a lot for your effort. 

    1213.JPG

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard