cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

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
Super User
Super User

Re: COLLECTIONS: Not refreshing last two days

Thanks for the follow up @TopShelf-MSFT . 
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
Dual Super User
Dual Super User

Re: COLLECTIONS: Not refreshing last two days

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

Super User
Super User

Re: COLLECTIONS: Not refreshing last two days

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)

Community Support Team
Community Support Team

Re: COLLECTIONS: Not refreshing last two days

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.
TopShelf-MSFT
Level 10

Re: COLLECTIONS: Not refreshing last two days

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

 

@TopShelf-MSFT 

Super User
Super User

Re: COLLECTIONS: Not refreshing last two days

Thanks for the follow up @TopShelf-MSFT . 
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

TopShelf-MSFT
Level 10

Re: COLLECTIONS: Not refreshing last two days

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

 

@TopShelf-MSFT 

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,864)