cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

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
Highlighted
Advocate II
Advocate II

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
Highlighted
Post Prodigy
Post Prodigy

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
Advocate II
Advocate II

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.

Highlighted
Advocate II
Advocate II

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,854)