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
Unanswered

Duplicates

(0) ShareShare
ReportReport
Posted on by

Hi

 

I have a gallery which eventually patches back to a SP list.

 

I can’t work out the logic to flag a warning if a chosen name from a person column together with a start and end date already exists, or any combination of the start and / or end date falls within an item already in the list? I’ve set the gallery to update on the ONCHANGE of the name and both datepickers but I can work out how to each this. 

Any help would be fantastic!

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @jed76,

    Do you want to push a warning notification when the selected date exists in the list?

    Could you please share a bit more about your scenario?

     

    If you want to check if there is an existing date, you could validate the date conflict by setting the button OnSelect as below:

    If(!IsBlank(LookUp(List,
     (StartDate <= DatePicker4.SelectedDate && DueDate > DatePicker4.SelectedDate) || 
     (StartDate < DatePicker5.SelectedDate && DueDate >= DatePicker5.SelectedDate) || 
     (StartDate < DatePicker4.SelectedDate && DueDate > DatePicker5.SelectedDate),PersonField=PeoplePciker.Selected.Email)),Notify("Not available for booking!",Error))

    DatePicker4 represents the from date picker and DatePicker4 represents the to date picker.

     

  • jed76 Profile Picture
    on at

    This sounds like just what I need!

     

    I will give it a try.

     

    Many thanks!

  • jed76 Profile Picture
    on at

    I think I must be entering your formula incorrectly as my person column doesn’t appear after the three OR statements to choose from? My person column in the list is called CrewName? Many thanks.

  • jed76 Profile Picture
    on at

    I’m getting there but this is flagging all the time. I need to flag if the date ranges exist but only if the CrewName column matches too? I presume I need the CrewName column within each AND statement?

  • jed76 Profile Picture
    on at

    I think I’m getting there but surely I need to patch back to the list each time as well so that I get a warning as soon as the change in the list is made? As it stands the warning won’t work until the back end list is updated?

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @jed76,

    If(!IsBlank(LookUp(List,
     ((StartDate <= DatePicker4.SelectedDate && DueDate > DatePicker4.SelectedDate) || 
     (StartDate < DatePicker5.SelectedDate && DueDate >= DatePicker5.SelectedDate) || 
     (StartDate < DatePicker4.SelectedDate && DueDate > DatePicker5.SelectedDate)) && PersonField=PeoplePciker.Selected.Email)),Notify("Not available for booking!",Error))

    I add a brackets to merge the three OR statements and combine this merged one with the person choice using the &&.

  • jed76 Profile Picture
    on at

    Many thanks!

     

    This still gives me an error though even if there is only one present. I need to be able to add one person with a set of dates and then flag if that same person is added again with the same date or within the date range?

  • jed76 Profile Picture
    on at

    Perhaps some kind of countrows instead?

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 463

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
11manish Profile Picture

11manish 275

Last 30 days Overall leaderboard