Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Combobox selected item resets value when I use ClearCollect

(0) ShareShare
ReportReport
Posted on by 364

Hi all, 

 

I have an app that lets people quote parts for customers. I am able to successfully create, save and load quotes - but have an issue when I try to edit them. 

 

The details of a quote are loaded into the app as collections. I have a collection called colEditBlowerDetails for when I am editing a quote. There is a ComboBox called "BlowerModel" which brings in the previously selected blower. When I try to re-save the quote, I re-collect all the data to save it again. My problem is, when I use ClearCollect the value from my combobox disappears, and nothing is added to the collection for it.

 

The default selected items property for the ComboBox is [First(colBlowerDetailsEdit).BlowerModel]

My clear collect function updates Blower Model with: ClearCollect(colBlowerDetailsEdit,
                                                                                                          {'Quote #': "Test2",
                                                                                                           BlowerModel: BlowerModel.Selected.'Product Name' ,

every other item I collect and save is done so successfully.

 

The combobox's items property is set to: Filter('Scope 2 Products', Text('Product Category') = "Blower")

 

If I manually enter a blower in the combobox, the ClearCollect function works properly. I only have this issue when trying to copy over the default selected item.

 

Does anyone know why I am not able to collect my combobox value, and then save it back to dataverse? 

 

The screen before I click "Button" (has the clearcollect formula in it)The screen before I click "Button" (has the clearcollect formula in it)The screen right after I click "Button" (has the clearcollect formula in it)The screen right after I click "Button" (has the clearcollect formula in it)

 

^ Before Clear Collect                                                                 ^After ClearCollect

 

  • AmeerJab Profile Picture
    370 on at
    Re: Combobox selected item resets value when I use ClearCollect

    Hello,

    using ClearCollect does clear the collection items, if you want to add you should use Collect, if you want to edit you need to use Patch.

    to use patch you need first to select the record you want to add wither by an ID or a unique column value ex:

    Patch(LookUp(collection, ID = varID),{Column: New-Value }).

    Regards.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,631 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,991 Most Valuable Professional

Leaderboard