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 / Checking if last share...
Power Apps
Answered

Checking if last sharepoint record has a field empty

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

Could I ask for help? I'm trying to check if the last record in a sharepoint list has a field empty.

 

Last(Filter(Employees_dump; PracovníkJméno = User().FullName) - getting the last record

 

Now I'm at a loss, I need to check if row "LongitudEnd" in the Sharepoint list "Employees_dump" is blank or not. 

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

     

    You could consider a formula something like this:

    If(IsBlank(Last(Employees_dump).LongitudEnd, …<your true and, false statements>)

     

    Not sure where you are planning to use the check, but that is one option.

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for the suggested code. Using your suggestion I edit my code to this: 

    If(
    IsBlank(
    Last(
    Filter(Employees_dump; PracovnikJmeno = User().FullName && Title = ThisItem.Title)).LongitudEnd)

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes

     

    Could I ask for a bit more help? I'm getting this weird bug - I open the app and press an 'arrival' button which runs this code: 

    Patch(Employees_dump; Defaults(Employees_dump); {Title: ThisItem.Title; PracovnikJmeno: User().FullName; Zacatek: Now(); LatitudStart:Location.Latitude;LongitudStart:Location.Longitude});; UpdateContext({Popup1:true; Popup2: false; prichodFirst:false});;

    That sucessfuly creates a record, I checked in Sharepoint. Then I press 'leave' button which runs this code:

    Set(record;Last(
     Filter(Employees_dump; PracovnikJmeno = User().FullName && Title = ThisItem.Title)));;
     
    If(
     IsBlank(
     record.LongitudEnd) && !IsBlank(record.Zacatek) && IsToday(record.Zacatek); 
    
    Patch(Employees_dump; record; {Konec: Now(); LatitudEnd:Location.Latitude;LongitudEnd:Location.Longitude} );;
    
    UpdateContext({prichodFirst:false; Popup2:true}) ; // zaznam existuje a ma prazdne pole pro odchod (LatitudEnd, LongitudEnd, Konec)
    UpdateContext({prichodFirst:true; Popup2:false})) // zaznam nema prazdne pole pro odchod

    but after pressing the 'arrival' button just once the if statement returns false. Only after pressing the 'arrival' button for the second time or reopening the app the if statement returns true and runs the patch function. I have no idea what's causing the issue. 

     

    Edit: we've tried on another phone and can't reproduce the issue

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    So based on your edit, are you stating that this is only happening on one device, or is this a problem on everything?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes 

     

    At the end it didn't work on other devices either. 

    The behaviour: 

    • when pressing leave first, then arrival and then leave it worked fine
    • when pressing arrival first (even multiple times) and then leave, it didn't go through (even after pressing leave multiple times)

     

    What seems to have solved it was putting this code to the app OnStart

    Set(record;Last(
     Filter(Employees_dump; PracovnikJmeno = User().FullName)))

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard