cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
crsnt
Level: Powered On

SharePoint list data not updated after Submit

Hi,

 

I customized a SharePoint list form. 
In the OnSave event, I did a custom validation before submitting the form i.e.:

If(
   ! IsBlank(
       LookUp('Course Review', 
       Title = ComboBox2.Selected.ProviderName & " - " & DataCardValue3.Selected.CourseUnit 
       And ReviewYear = Year(DataCardValue7.SelectedDate)
       )),
   Notify("Course review for this school and course unit already exists for that year.", NotificationType.Error),
   SubmitForm(SharePointForm1)
)

It works nicely, but only when I do a page refresh between items.

The issue is, after submitting Item 1, if I try to add another Item that is a duplicate, it does not detect the duplicate and it lets me save it. However, if I try to add the same item a second time, it correctly throws error.

The same issue happens if I deleted the item. If I try to add the same item back, it throws error. However if I click 'Save' the second time it lets me save it.

Looks to me the list data is not refreshed after submission or deletion? I tried doing Refresh(datasource) after SubmitForm, in the OnNew event but it doesn't seem to fix it.

Any ideas? Thanks.


1 ACCEPTED SOLUTION

Accepted Solutions
crsnt
Level: Powered On

Re: SharePoint list data not updated after Submit

Looks like some of the experimental features were turned on when I customized SP list form... 
I bet this is the culprit: 
Use longer data cache timeout and background refresh

 

I turned off all experimental features and it works better now. Will report if I find anything else.

View solution in original post

3 REPLIES 3
simms7400
Level 8

Re: SharePoint list data not updated after Submit

Easy fix, refresh your table after you submit.

 

I'd place this on your OnSuccess property or Submit.

 

Refresh(TableName)
Highlighted
crsnt
Level: Powered On

Re: SharePoint list data not updated after Submit

I've tried that it does not work. 
my OnSuccess:

ResetForm(SharePointForm1);
Refresh('Course Review');
RequestHide()

It still let me save the record the 2nd time I create the same record. The 3rd time it works.
If I refresh the page it always works.

I think there is a bug somewhere
There is a similar thread unanswered:
https://powerusers.microsoft.com/t5/General-Discussion/How-to-handle-the-PowerApps-cache/td-p/176475

but I don't want to create a duplicate list as a workaround.

crsnt
Level: Powered On

Re: SharePoint list data not updated after Submit

Looks like some of the experimental features were turned on when I customized SP list form... 
I bet this is the culprit: 
Use longer data cache timeout and background refresh

 

I turned off all experimental features and it works better now. Will report if I find anything else.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,947)