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 Platform Community / Forums / Power Apps / The component datePice...
Power Apps
Suggested Answer

The component datePiceker in Gallery will show the initial data when we multiple update

(0) ShareShare
ReportReport
Posted on by 58
We have Gallery and put the component "DatePicker in the Gallery as below
 
 
 
The Gallery should get the data from the Collection "colScheduleGal"
 
 
And the DatePicker DefaultDate is 
 
 
 I try to  update the 3 records to a new date as below
 
 
Then i Click the tick button , the tick button logic is update the collection "colScheduleGal"
 
After I tick the first record, the second record and third record will initial to the original value
 
 
Then i try again , change the 3 record as blow 
 
 
After i tick the first record again, second row and third row is normal to keep to update value
 
 
May i k know what is the root cause for this situation, any suggestion?
 
 
Categories:
I have the same question (0)
  • Suggested answer
    Kalathiya Profile Picture
    175 on at
    Hello @samxu
     
    Root cause is that the DatePicker only shows temporary values until you patch them into the collection. Updating one record refreshes the Gallery, resetting others unless you save all changes.
     
    Here are a two approaches you can take:
     
    Option 1: Patch all record at once
    Instead of updating only the first record on tick, loop through the Gallery and patch all changes:
    Here’s the example using ForAll:
    ForAll(
        Gallery1.AllItems As _obj,
        Patch(
            colScheduleGal,
            LookUp(colScheduleGal, ID = _obj.ID),
            { ScheduleDate: _obj.DatePicker1.SelectedDate }
        )
    )

    You can add a condition inside the ForAll so only records meeting criteria are updated.

    ForAll(
        Gallery1.AllItems As _obj,
        If(
            !IsBlank(_obj.DatePicker1.SelectedDate),   // condition
            Patch(
                colScheduleGal,
                LookUp(colScheduleGal, ID = _obj.ID),
                { ScheduleDate: _obj.DatePicker1.SelectedDate }
            )
        )
    )
    Option 2: Use a temporary collection
    Store user edits in a separate collection (e.g., colEdit ) as they change values.
    On final Submit, merge  colEdit back into colScheduleGal collection.
    This will help to avoide losing changes when a Gallery control is refreshes upon click on "Tick" save icon. 
     
    📩 Need more help? Mention@Kalathiya anytime!
    ✔️ Don’t forget to Accept as Solution if this guidance worked for you.
    💛 Your Like motivates me to keep helping
     
     
     
     
  • samxu Profile Picture
    58 on at
     
    Thanks for your information and i will try your suggestion. But i still have 1 question after read your feedback. As you mentioned , the datePicketr just stored the temporary value.  After i patch the collection , it will refresh the Gallery.
     
    This only happened at the first time. After I completed the tick, if i try again to update the datePicker , then tick again, it will patch the collection , but the datepicker value not be refresh  and it will keep the temporary value for second time.
     
    This is the point i can't understand. Why the first time is not work, and second time it can work.

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 739 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 268

Last 30 days Overall leaderboard