Reputation: 61
I have a primary SharePoint list (Over-Rides) and a secondary SharePoint list (Over-ride Authorisations) which can contain multiple lines relating to the primary list ID (Called OverrideLogNo in the secondary list).
In my Power App I needed to create a collection to create a subgroup of the secondary SharePoint list (Over-ride Authorisations) only returning the most recent row for each primary list ID (OverrideLogNo).
I created the collection (code below), put it in OnVisible on the first screen on start, and it works, however, when I save and close the App then reopen it, it no longer works.
But if I delete a row of the code, click on another screen, click back and re add the code I deleted. It all works again.
The collection should re run and refresh the data every time the App is opened or the user clicks away to another screen and back again. But it doesn't.
What am I missing?
ClearCollect(
collApproveMax,
DropColumns(
AddColumns(
GroupBy('Over-ride Authorisations',OverrideLogNo,Created),
AuthStatus,Max(Created,AuthStatus),
InitAuth,Max(Created,Auth),
AddAuth,Max(Created,AddAuth),
RemoveDt,Max(Created,(If(IsBlank(RemovalDate),0,1))),
IsRemoved,Max(Created,IsRemoved),
AuthDt,Max(Created,AuthorisedDate)
),
Created
)
);
Upvotes: 0
Views: 305
Reputation: 61
I'd renamed a SharePoint list column, which was the source data, then adjusted the code to show the columns new name. But SharePoint lists retains the old name and the new name is just for display purpose. So changing the column name in the code broke it. Once I reverted back to the original column name, everything worked again.
Upvotes: 0
Reputation: 1086
You need to use Timer Control to refresh your collection data, There is a sample canvas app with name Inventory Management, it has the example of timer control with collection.
Upvotes: 0