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 / Question on Lookups fo...
Power Apps
Answered

Question on Lookups for conditionally setting variable

(0) ShareShare
ReportReport
Posted on by 1,088

I have an edit form on a screen that does a lookup like this:

LookUp(Sponsor_1, 'Person to Sponsor'.DisplayName = User().FullName && Status.Value <> "Class Attended")
 
Which works if there is an item in SharePoint.
 
But if there's not a record I want a popup to tell the person they need to submit an application.
 
I tried adding a formula onVisible to the screen:
If(IsEmpty(LookUp(Sponsor_1, 'Person to Sponsor'.DisplayName = User().FullName && Status.Value <> "Class Attended")), Set(ShowError, true), Set(ShowError, false))
 
So the same lookup, if doesn't return a record and IsEmpty then set the error and then the visibility of the popup depends on that variable...
 
But it is saying it is empty even when it is not... always comes up true... And even though it is coming up true, it never sets the variable to true?
 

sshot-3013.pngsshot-3012.png

 

 
Anyone see what I am doing wrong?
 
Thanks,
Terry
Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,921 Most Valuable Professional on at

    Hi @Mattw112IG ,

    Try this

    If(
     IsBlank(
     LookUp(
     Sponsor_1, 
     'Person to Sponsor'.DisplayName = User().FullName && 
     Status.Value <> "Class Attended",
     'Person to Sponsor'
     )
     ),
     Notify("You need to complete new form")
    )

     

    Please click Accept as solution 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 Thumbs Up.

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 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard