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 / PowerApps If Lookup Em...
Power Apps
Answered

PowerApps If Lookup Empty then display a message

(0) ShareShare
ReportReport
Posted on by 73

Hello,

 

I am working on an app where I have a lookup function on a text input box to exactly look and match the co-ordinates of a location in the SharePoint list and display the Title of the co-ordinates and the below function is getting the value perfectly. 

 

LookUp('SharePoint List',field_1 = Location.Latitude && field_2 = Location.Longitude).Title

 

Now what I want is that to display a message "You are not at a Station" on the same text box if the co-ordinates doesn't match any record. How can I achieve this? I tried If, Lookup with Is Empty and also Isblank but it is throwing error.

 

Please help.

 

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @PowerUser39,

     

    We can check whether the LookUp is blank and conditionally display a text value:

    With(
     //Temp save record to a function variable
     {
     wRecord: LookUp(
     'SharePoint List',
     field_1 = Location.Latitude && field_2 = Location.Longitude
     )
     },
     //Display the first value that is not blank
     Coalesce(wRecord.Title, "You are not at a Station")
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • PowerUser39 Profile Picture
    73 on at

    Thanks @LaurensM It worked 🙂

  • PowerUser39 Profile Picture
    73 on at

    @LaurensM Need your help again. I trimmed your solution to replace selected text from gallery list and current code is below.

     

    If(
    IsBlank(SelectedLocation),
    With(
    {
    wRecord:
    LookUp(
    'SharePoint List',
    field_1 = Location.Latitude && field_2 = Location.Longitude
    )
    },
    Coalesce(
    wRecord.Title,
    "You are not at a Substation"
    )
    ),
    SelectedLocation
    )

     

    The above solution checks whether the Lookup is blank and displays a text value inside the same Textbox and also adds the selected value from Gallery list. Now what I want is that to display the conditional text as a notification rather displaying it inside the textbox. How to do this?

     

    The below is the one I have but not sure how to include this in the above code?

     

    If(
    !IsBlank(SubstationInput.Text),
    Notify("You are not at a Substation. Please click the location icon next to Substation Textbox and choose your Station.",NotificationType.Information)
    ).

     

    I tried including the above If in the original If statement but throwing error.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard