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

Collections dont seem to be updating.

My collection is not updating and seems to be displaying old data even though I am using ClearCollect()..  It is as if the collection is not updating at all. This was working yesterday but is no longer working today. What I am doing is very basic.

I am creating a collection based on Azure Resource Manager - Resource Group List.

I have one command in screen onvisible: 

ClearCollect(ResourceGroups,AzureResourceManager.ResourceGroupsList("........"));

 

The collection has data in it after I run the app but when I compare details in the details in the collection to the resource groups in the Azure Portal, the resource group information does not match. Seems like the collection is still showing yesterdays data. I removed tags from a resource goup this morning to test this but when I check my collection it is showing the tags that were removed.

1 ACCEPTED SOLUTION

Accepted Solutions
amandalee
Level: Powered On

Re: Collections dont seem to be updating.

Thanks Kris for your great explanation here. My app was working one day and not the next. Nothing I did would reresh the data supposedly coming from ARM. Since Everything stopped working so suddenly I thought there maybe a connection issue between Powerapps and ARM. I decided to stop trying to fix the issue and wait a day. However, I went on leave the day after I posted on Powerapps Community and have only returned today to find everything working as it should. I have not changed anything because before I went away I restored the last version of the app that I created on the day the app was last working. I do think there was an issue between Powerapps and ARM. The data from ARM was not reaching the app for whatever reason. All working now though. Thank you for confirming my ideas and for the additional notes you've provided. They will come in handy!

5 REPLIES 5
Super User
Super User

Re: Collections dont seem to be updating.

I don’t have any experience with the Azure Resource Manager, so this may not be too helpful, but have you tried putting a

Refresh(AzureResourceManager.ResourceGroupsList(“.....”));

in front of your ClearCollect? It may not be refreshing your source and just recollecting what PowerApps has cached.

Also, just another though: if you have the semicolon at the end and it is the only command, it may be throwing an error and not running the code as it is expecting something afterward. Maybe try removing the semicolon at the end if there is nothing after it.

*Edit to clear up suggested code and add some clarity
amandalee
Level: Powered On

Re: Collections dont seem to be updating.

Thanks for getting back to me. I dont think you can refresh the Azure Resource Manager connection. When I view datasources in edit mode and try to fresh it from there, there is no refresh button. When I add Refresh(AzureResourceManager.ResourceGroupsList("......")) and run the app it does not resolve the issue either.

 

The semicolon was there because I did have a second line of code creating a different collection.

Community Support Team
Community Support Team

Re: Collections dont seem to be updating.

Hi @amandalee,

I think your thought is correct. The AzureResourceManager is a functionable/action data source rather than a Table data source, so you could not refresh your AzureResourceManager data source using Refresh function.

Note: Currently, the Refresh function only works with Table data source within PowerApps.

 

More details about the types of data source within PowerApps, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/connections-list

 

If you type the ClearCollect function within the OnVisible property of a screen, the ResourceGroup collection data would be refreshed only when the corresponding screen is visible.

 

If you want to refresh your ResourceGroup collection data within your app, you could consider refresh manually or refresh automatically.

If you want to refresh your ResourcesGroup collection data manually, you could consider take a try to add a Button control called "Refresh Manually" within your app, then set the OnSelect property to following:

ClearCollect(ResourceGroups,AzureResourceManager.ResourceGroupsList("........"))

If you want to refresh your ResourcesGroup collection data automatically, you could consider take a try to add a Timer control within your app, configure it for refreshing ResourcesGroup collection data every 1 second:

Set the Duration property of the Timer control to following:

1000

Set the AutoStart property of the Timer control to following:

true

Set the Repeat property of the Timer control to following:

true

Set the OnTimerEnd property of the Timer control to following:

ClearCollect(ResourceGroups,AzureResourceManager.ResourceGroupsList("........"))

 

In addition, please also check if the connection to the AzureResourceManager connector is invalid. Please take a try to re-create a new connection to the AzureResourceManager connector, and then check if the issue is solved.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amandalee
Level: Powered On

Re: Collections dont seem to be updating.

Thanks Kris for your great explanation here. My app was working one day and not the next. Nothing I did would reresh the data supposedly coming from ARM. Since Everything stopped working so suddenly I thought there maybe a connection issue between Powerapps and ARM. I decided to stop trying to fix the issue and wait a day. However, I went on leave the day after I posted on Powerapps Community and have only returned today to find everything working as it should. I have not changed anything because before I went away I restored the last version of the app that I created on the day the app was last working. I do think there was an issue between Powerapps and ARM. The data from ARM was not reaching the app for whatever reason. All working now though. Thank you for confirming my ideas and for the additional notes you've provided. They will come in handy!

CaoTriNguyen
Level: Powered On

Re: Collections dont seem to be updating.

I had the same problems and it was solved just by opening the app in MS. Edge instead of Chrome, silly problem