cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ericonline
Community Champion
Community Champion

COLLECTIONS: Not refreshing last two days

Seems to be something going on with caching lately. Anytime I delete a record from a Sharepoint DataSource then recollect, the record is still present. The only way to clear it is to View/DataSources/Refresh. 

Anyone else experiencing this?

Example:

  • Gallery control
    • Items: colTest
  • Delete Icon (in Gallery)
    • OnSelect:
      • Remove(SHAREPOINT_DATA_SOURCE, ThisItem, All);
        • Also tried RemoveIf(SHAREPOINT_DATA_SOURCE, ID = ThisItem.ID)
      • ClearCollect(colTest, SHAREPOINT_DATA_SOURCE)
  • Collection colTest still shows the deleted record though the Sharepoint list shows it deleted.
  • View/DataSources/Refresh then ClearCollect(colTest, SHAREPOINT_DATA_SOURCE) AGAIN and everything is synced.

PowerApps: Editor (not tested in app yet)

Editor Version: PowerApps 3.19082.20

SessionID: aa87e252-64e4-4ca9-9b6c-583d19d55a29

Location: WestUS

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for the follow up @Anonymous . 
I had the issue in 2 apps. My reply above solved the the first issue. Here is how I solved the 2nd issue:

Screen 1: 

  • OnVisible: ClearCollect(colTest, SHAREPOINT_LIST)

Screen 2:

  • OnSelect of "Submit" button:
    • Patch(SHAREPOINTLIST, LookUp(SHAREPOINT_LIST, ID=varID), {AddRemove: "Remove"})
    • RemoveIf(colTest, ID=varID)
    • Navigate(Screen1, Cover)

Flow:

  • When a record is created/modified in SHAREPOINT_LIST, fire off Flow
  • In this case, when the AddRemove column is changed to "Remove", do things.
  • BUT... the Flow takes ~30secs to 1min to run

The astute PowerApper can see why "the record is not being removed from the collection". Because OnVisible of Screen1, the record still exists in the SHAREPOINT_LIST. 

Solution:

  • I moved the RemoveIf() to Screen1 OnVisible AFTER the ClearCollect.
  • Now the record with ID=varID is correctly removed from the Collection

View solution in original post

6 REPLIES 6
RezaDorrani
Dual Super User II
Dual Super User II

Hi @ericonline 

 

just made a simple test and it worked

 

OnVisible - ClearCollect(colData,list)

 

Button click - Remove(list,First(colData));ClearCollect(colData,list)

 

List item got deleted and collection did not show that record

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

This was the issue:

Remove(SHAREPOINT_DATA_SOURCE, ThisItem, All) needed to be changed to:

Remove(SHAREPOINT_DATA_SOURCE, LookUp(colTest, ID = ThisItem.ID), All)

Hi @ericonline ,

I have tested these two formulas:

Remove(SHAREPOINT_DATA_SOURCE, ThisItem, All) 

Remove(SHAREPOINT_DATA_SOURCE, LookUp(colTest, ID = ThisItem.ID), All)

and all not met the problem like your description.82912.PNG

Please clean your browser's cache,update it to the latest version and try again.

What's more, the network condition is also important.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @ericonline are you still experiencing this issue with Collections? 

 

@Anonymous 

Thanks for the follow up @Anonymous . 
I had the issue in 2 apps. My reply above solved the the first issue. Here is how I solved the 2nd issue:

Screen 1: 

  • OnVisible: ClearCollect(colTest, SHAREPOINT_LIST)

Screen 2:

  • OnSelect of "Submit" button:
    • Patch(SHAREPOINTLIST, LookUp(SHAREPOINT_LIST, ID=varID), {AddRemove: "Remove"})
    • RemoveIf(colTest, ID=varID)
    • Navigate(Screen1, Cover)

Flow:

  • When a record is created/modified in SHAREPOINT_LIST, fire off Flow
  • In this case, when the AddRemove column is changed to "Remove", do things.
  • BUT... the Flow takes ~30secs to 1min to run

The astute PowerApper can see why "the record is not being removed from the collection". Because OnVisible of Screen1, the record still exists in the SHAREPOINT_LIST. 

Solution:

  • I moved the RemoveIf() to Screen1 OnVisible AFTER the ClearCollect.
  • Now the record with ID=varID is correctly removed from the Collection

View solution in original post

Anonymous
Not applicable

Thanks for the follow up @ericonline! This should be extremely useful for any other users who run into this issue

 

@Anonymous 

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (51,257)