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 / Setting button display...
Power Apps
Answered

Setting button display mode based on the existence of data in multiple fields

(0) ShareShare
ReportReport
Posted on by 24

Hello,

I have a button for submitting data to a sharepoint list. There is a date picker and if the user leaves it blank the button's display mode is set to disabled. This is done using IsBlank and is working fine. However, I would also like the form to check if they date they entered is already in the list and if it is, leave the button disabled. 

If all I needed was to check for the existence of the date, I could use IsBlank to handle it but since one statement is triggered when the value exists and the other is triggered when the picker is empty, I end up with conflicting IsBlank Statements. 

I'm not a power apps pro so I'm sure there's something I'm missing. 

Any help would be appreciated.  

Thanks in advance!

Categories:
I have the same question (0)
  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @bh360 you have two options.

     

    1. Change the field in SharePoint to only allow unique values. This would prevent of adding items with the same date 

     

    2. To check if an item exists you need to use a LookUp() function.

     

    To combine your first check with the LookUp() your formular will look like this

     

    If(IsBlank(....) || IsBlank(LookUp(....),Disabled,Edit)

     

    Sorry for the short answer but I am on my mobile.

     

     

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

    @bh360 

    Set your DisplayMode property to:

    If(
     IsBlank(yourDatePicker.SelectedDate) || 
     LookUp(yourDataSource, dateColumn=yourDatePicker.SelectedDate, true),
     Disabled,
     Edit
    )

     

    The LookUp function will return whatever you want if it finds a record based on the criteria.  In the above, we are asking it to return true...so, if the record exists, the LookUp returns true and that being true or the selected Date being blank will cause the display mode to be Disabled.

     

    I hope this is helpful for you.

  • bh360 Profile Picture
    24 on at

    Thanks for the reply and no worries about the short response. The format suggested by RandyHayes below ended being working for me. 

  • bh360 Profile Picture
    24 on at

    That did the trick. I'm fairly new to power apps and I'm still learning the structure. The ",true" on the end of the lookup was what I was missing. Thanks for the help!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard