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

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

Issue with comparing datepicker value with related sharepoint column

(0) ShareShare
ReportReport
Posted on by 8
Hello everyone,
I am building gallery in PowerApps in which users shall be able to update date with power picker feature. I am linking it to Sharepoint list in which i have Date column.
 
I am trying to check if user changed date, to verify if gallery row needs to be patched to shp.
 
DefaultDate for datepicker is set to ThisIstem.assignmentEndDate.
 
I am trying to compare ShP list, to datepicker value, but for each time I receive True response for below conditions:
 
1st try: ThisIstem.assignmentEndDate <> dpAEndDate.SelectedDate
2nd try: Text(ThisIstem.assignmentEndDate, "dd/mm/yyyy") <> (dpAEndDate.SelectedDate, "dd/mm/yyyy")
 
With bot config I receive TRUE response, even if date was not updated, and is presenting Date stored in Sharepoint.
 
Therefore can anyone advise me how to compare data between datepicker and shp "Date and time" list column correctly? 
I have the same question (0)
  • Suggested answer
    abc 123 Profile Picture
    784 Moderator on at
    Issue with comparing datepicker value with related sharepoint column
    In the OnSelect of the datepicker, set a variable to the current value.
    UpdateContext({dtmOldValue: ThisIstem.assignmentEndDate});
     
    In the OnChange of the DatePicker, check for equality, then react accordingly.
     
    If(dtmOldValue <> dpAEndDate.SelectedDate, 
      Patch(...
      )//End Patch
    ); //End If
  • Suggested answer
    AndrianaO Profile Picture
    213 Moderator on at
    Issue with comparing datepicker value with related sharepoint column
    Hi, I tested your approach and I received a correct comparison result, so I am unsure what causes the problem in your case.
     
     
     
    But I have an idea for you. Instead of comparing, you can set the OnChange property of your DatePicker control as:
     
    Patch('Test List',LookUp('Test List', ID = ThisItem.ID),{assignmentEndDate: dpAEndDate.SelectedDate})
     
    where 'Test List' is the name of the SharePoint list.  
     
    Let me know if this helps!
  • BurtekWu Profile Picture
    8 on at
    Issue with comparing datepicker value with related sharepoint column
     
    I wanted to avoid using OnChange property, as I have over 30 columns in this gallery, so it's not the most efficient way of patching updates. I wanted to use Toggle as indicator of updated rows.
     
    I was expecting result the same as in AndrianaO case, but in my case it's not working. I am surprised that also using Text() approach is not working - despite it shall return the same results. 
     
    I believe my issue might be result of some locales config difference between PowerApps and related ShP... I have to dig deeper. 
     
    Anyway, thank you for provided answers so far. 

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

Coming soon: forum hierarchy changes

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

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 624 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 384 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 246

Last 30 days Overall leaderboard