web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Refresh a Coolection a...
Power Apps
Unanswered

Refresh a Coolection after submitting a button

(0) ShareShare
ReportReport
Posted on by 3,514

I have the following formulas, to GroupBy the items by Title inside a gallery:-

 

ClearCollect(
 colSource,
 Filter(
 'Grant Applications',
 (CurrentState = "0" && Category.Value = "Solicited") || (CurrentState = "1" && Category.Value = "Unsolicited") || (CurrentState = "50" && Status.Value = "RejectOnly")
 )
);
// Create a collection of all daily appointments
ClearCollect(
 colGrants,
 AddColumns(
 ShowColumns(
 colSource,
 "ID",
 "GrantTitle",
 "Grantee",
 "GrantAmountRequested_x0028_inUSD",
 "Category",
 "ApplicantEmailAddress"
 ),
 "Level",
 2
 )
);
// Create a collection of all unique Title values
ClearCollect(
 colGrantTitles,
 AddColumns(
 RenameColumns(
 Distinct(
 colSource,
 GrantTitle
 ),
 "Result",
 "GrantTitle"
 ).GrantTitle,
 "Level",
 1
 )
);
// Combine both collections into a single collection
ClearCollect(
 colCombinedGrants,
 colGrants,
 colGrantTitles
);
//// *** NEW CODE ****
// Sort the combined collection
ClearCollect(
 colSortedGrants,
 SortByColumns(
 colCombinedGrants,
 "GrantTitle",
 "GrantAmountRequested_x0028_inUSD",
 "Level"
 )
);

 

and beside each item we have Approve and Reject buttons, with the following onSelect property for the Reject button:-

 

Patch('Grant Applications',LookUp('Grant Applications',ID=ThisItem.ID),{
 Status:{Value:"Rejected"},
 CurrentState: "60"
 }
);

 

so based on my first formulas, Rejected items should not appear in the gallery, but the issue we are facing is that when the user clicks on the Reject button the related item will still be shown, unless we refresh the browser. so is there a way to make my gallery more dynamic? as a workaround i am currently copying the first formulas to reconstruct the collection again after clicking on the reject button.. but is there a more accurate way of doing this? without having to reload the data each time a button is clicked?

Categories:
  • goel_gagandeep Profile Picture
    141 on at

    Hi @johnjohn123 , There is no option for refreshing the collections, but for now you can call the same collection on the on select property of the Approve and Reject button. it will help you to refresh the collection.
    I hope it will work.
    Thanks.

  • johnjohn123 Profile Picture
    3,514 on at

    @goel_gagandeep this what i am actully doing, but i ended up having the same formulas in 3 different places, is there a way to call and reuse a shared formula?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard