cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Adwene
Frequent Visitor

SP list not updating from editable grid in PowerApps

Good day

I have an editable grid in Powerapps that is linked to a SP list. Users need to enter dispatch date and receive date in the grid and then it should save to the SP list. I used this formula in the OnSelect function of the SAVE button 

Patch('HR File track list',Update(MySPCollection),{field_7:DatePicker3_1.SelectedDate,field_8:DatePicker3.SelectedDate}) 

PLease assist.

Adwene_1-1649402268193.png

 

 

8 REPLIES 8
C-Papa
Super User
Super User

Try this

Patch('HR File track list',{ID:ThisItem.ID},{field_7:DatePicker3_1.SelectedDate,field_8:DatePicker3.SelectedDate})

Adwene
Frequent Visitor

That works perfect thank you, but after the save the dates disappears from the grid in PA.

Is there a way that the dates can stay in grid in PA?

C-Papa
Super User
Super User

you need to change the default date of the date picker to which ever column contains the date in the sharepoint list, i.e. Thisitem.field_7

If your column is not a Date Time column but just a text column you will need to convert it to a date i.e. DateValue(Thisitem.field_7)

Adwene
Frequent Visitor

If I do that then the grid looks like this. Once the dates are typed in, then the dates I typed disappear and the grid change back to this.

Adwene_0-1649412009901.png

 

Adwene
Frequent Visitor

Only first line of my SP list updates the dates.

Adwene_1-1649412203752.png

 

C-Papa
Super User
Super User

you have a save button on each line, therefore, you are only updating one record at a time, not all records. The dates are appearing correctly, there date value in SharePoint is blank, so it will display the data as shown in your image, but notice the two that you have saved have the correct dates in. 

Adwene
Frequent Visitor

The dates I enter in line 1 of grid, saves next to last line in grid.

Adwene_0-1649418371280.png

 

C-Papa
Super User
Super User

on your gallery items are you sorting it by date modified? if you are, when you save the list order will change

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (3,119)