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 Apps
Answered

SQL If statement

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

So i'm struggling for a while on a piece of code. Im fairly new to Power Apps. So i want to do an IF statement on a column customerID. Basically i want to check if the SelectedcustomerID exists in the customerID column. IF it doesn't my label should say "Not Signed".

 

This is what i have so far:

 

If(LookUp('[dbo].[signaturetest]',customerID=selectedCustomerID),"Signed","Not Signed")

 

So IF the selecterCustomerID exists in the customerID column my label should say Signed.

 

Thanks in advance,

 

Anthony

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,730 Most Valuable Professional on at

    Hi @Anonymous ,

    Something like this should do it

    If(
     CountRows(
     Filter(
     '[dbo].[signaturetest]',
     customerID=selectedCustomerID
     ) >0,
     "Signed",
     "Not Signed"
     )
    )

     

    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.

  • PaulD1 Profile Picture
    2,914 on at

    You might try:

    If(LookUp('[dbo].[signaturetest]',customerID=selectedCustomerID, true),"Signed","Not Signed")

    Note the third argument in the LookUp - true. Normally the third argument is for the name of the column whose data you want to return. If the third argument is blank the whole record is returned. If you set the third argument to true, it should return true only if the condition is met. 

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard