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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / removing item from col...
Power Apps
Answered

removing item from collection not working

(1) ShareShare
ReportReport
Posted on by 90

The solution to this should be easy but so far I have not been able to find the correct syntax.

Dropdown1 is populated using a collection, colPurposes.

I want Dropdown2 to be the same collection less the item selected in Dropdown1.

Dropdown1 items: colPurposes

Dropdown2 items: Remove(colPurposes,'itemContents'=Dropdown1.Selected.'itemContents')

The remove doesn't work.

I have also tried:

RemoveIf,

putting the selection in Dropdown1 in a variable and trying to compare that in the Remove,

Remove(colPurposes,{Value: Dropdown1.Selected.'itemContents'})

I also added temp text fields to display the value in the Selected item.

Any direction appreciated.

 

Categories:
I have the same question (0)
  • Daniel Bocklandt Profile Picture
    5,117 Super User 2025 Season 2 on at

    Hey @disappointed ,

     

    you can use the Remove function like this: 

    Remove(colPurposes,Dropdown1.Selected)

    Remove and RemoveIf functions - Power Platform | Microsoft Learn

     

    I've never tested it this way so let me know if it works. 

     

     

  • disappointed Profile Picture
    90 on at

    Good try but it didn't work. I get the "There is an error in this formula. Try revising and running it again. Data type: Record."

    Like I say, it should be simple.

  • Daniel Bocklandt Profile Picture
    5,117 Super User 2025 Season 2 on at

    Then we will do it the old Fashioned way: 

    Remove(colPurposes,LookUp(colPurposes, ID=Dropdown1.Selected.ID))

    This should work. Just make sure where to put the code. It can't be placed as Item in Dropdown 2

     

  • disappointed Profile Picture
    90 on at

    I have been trying to put it in items. Dropdown2 is not visible until a selection is made in Dropdown1. What's your recommendation for where it should go?

  • Verified answer
    Daniel Bocklandt Profile Picture
    5,117 Super User 2025 Season 2 on at

    It has to go in a button or OnChange. However OnChange has the risk to delete a Record that has been selected by accident. To just use the Itsem proprty you could do this: 

    Filter(colPurposes, ID <>DropDown1.Selected.ID)

     

    Your collection does not lose Data but the dropdown 2 will not show the record selected in Dropdown 1.

     

  • Verified answer
    disappointed Profile Picture
    90 on at

    Yes!!! This syntax worked. Thank you.

    Carter

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 386 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 361

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard