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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Answered

SQL If statement

(0) ShareShare
ReportReport
Posted on by

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:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,117 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard