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 / ClearCollect not worki...
Power Apps
Unanswered

ClearCollect not working on choices

(0) ShareShare
ReportReport
Posted on by 938
Hello - I have a ClearCollect on a page to allow users to update choices - it all works - but if I make more than one change (add update or delete a choice)  if I run ClearCollect again and the collection does not refresh.
ClearCollect will work once then not subsequent times  
 
any workarounds here? thx 
 
 
Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    Where in your app are you running the ClearCollect?  If its the OnVisible property that only runs the first time the screen is loaded.  The other problem is that making a change to the schema of a backend data source won't take effect in the application until the data source is refreshed.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • ctedesco3307 Profile Picture
    938 on at
    @Pstork1 its on  the OnSelect property of a button and the collection is directly to the Global Choice List not a table. if I try and do a Refresh(GlobalChoiceList)  I get an error only Managed connections can be refreshed. 
  • Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    Try doing a Refresh on the Table that uses the GlobalChoiceList.  That may Refresh the connection to the list.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • ctedesco3307 Profile Picture
    938 on at
    @Pstork1 - yeah - I thought of that already - no luck 
  • ctedesco3307 Profile Picture
    938 on at
    @Pstork1  If  I do a hard refresh  by clicking on the '...' in the side data panel and then run the clear collect it works but using the Refresh() function on the button does not - tried both of these options 
     
     
     
     
  • Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    Unfortunately, That is about what I expect.  Refresh(DataSource) as a statement refreshes the Data in the Data Source, but not the schema.  What you are doing makes a change to the Schema itself.  So that requires a Refresh of the Connection itself, not just the data.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • JuanF Profile Picture
    5 on at
    First I would ask myself: is  "colExceptions" collection not updating correctly or is it the dropdown that is not showing additions/deletions? Because I would troubleshoot either differently.

    You can also try to make direct additions onto the Collection by using Collect.
     
    Add
     
    Collect(
    MyCollectionName,
    {
    FieldName1: Value
    }
    )
     

    Or Delete
    Remove(MyCollectionName, LookUp(YourCollection, Column = Dropdown.Selected.Value))
     

    Or Update
    Update(MyCollection, LookUp(MyCollection, ColumnFromCollection = Dropdown.Selected.Value), { Column: Value, Column2: "Text", Column3: 30 })
     
    Essentially, you don't need to clear the collection everytime you are changing it. Hopefully this will help you troubleshoot your issue. Another way could be to create a secondary Collection and use that to feed the other. Cheers.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard