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.

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.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 17 members 4,295 guests
Please welcome our newest community members: