cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
geneZebra
Level 8

dropdown value bug with addcolumns

I have a dropdown that displays items based on a collection that uses addcolumns. The collection is calcuated based on a button.onSelect. All works fine except if I edit the button.onSelect function in studio. It seems the edit in studio causes the collection to be reset which is fine but the problem is the dropdown control loses the reference to the columns added in addcolumns. The dropdown's value property  changes to show some other column in the data source that is not returned by addcolumns. 

Is there any way to edit the value property to help correct this issue. The development studio only exposes a dropdown list.  To work around this, I need to select a fixed col in the value list (which seems to cause a recalc on the collection) then set the value property again to point to the col that addColumns added. I need to repeat this on several controls that are based on the same collection accross several screens. 

4 REPLIES 4
Community Support Team
Community Support Team

Re: dropdown value bug with addcolumns

Hi @geneZebra 

 

What is your Dropdown's Items formula expression?

Do you want to show the New Added Column in the Dropdown control?

You can try this:

For example:

Button.OnSelect= ClearCollect( IceCreamSales,
Table(
{ Flavor: "Strawberry", UnitPrice: 1.99, QuantitySold: 20 },
{ Flavor: "Chocolate", UnitPrice: 2.99, QuantitySold: 45 },
{ Flavor: "Vanilla", UnitPrice: 1.50, QuantitySold: 35 }
)
)

Dropdown.Items=AddColumns( IceCreamSales, "Revenue", UnitPrice * QuantitySold ).Revenue

dropdownnewcolumn.PNG

Best Regards.

Yumia

geneZebra
Level 8

Re: dropdown value bug with addcolumns

My items property is simply the collection I created. I use the AddColumns formula when I create the collection (in the button property like you showed below). I have column created called "DisplayName" which is basically the name I want dropDowns to use when displaying the choices. I rather not recreate the display name on each drop drop as I am using the same collection for various controls.

 

I can work around this issue as you suggested  but I figured I'd post this issue since this seems like a bug. The dropdowns value property which I cannnot access in code should not be changed if it is not changed.

 

Thanks anyway.

 

Community Support Team
Community Support Team

Re: dropdown value bug with addcolumns

Hi @geneZebra 

 

Could you please show screenshot of your issue?

 

Best Regards.

Yumia

geneZebra
Level 8

Re: dropdown value bug with addcolumns

I had some issues with tryng to duplicate this with an example form scratch but I think it occurred once on the create from scratch sample attached. Main Scenario is 
1) createCollection with new cols added (e.g. "Displayname") in  a button.OnSelcect method.

2) Add a dropDown and set items equal to the collection (e,.g. Dropdown.items=IceCreamSale)

3) set the value property of the dropdown to a newly added col (e.g. "Displayname")

4) change some text in the Button's OnSelect method. This seems to clear out the collection in studio

5) notice that the dropdown lost the added col and it's value property is set to a col that is prior to addcol

6) in the sample app attached, I could not duplicate this reliably (but in my real app I see 100% of the time). However, in the sample app I did notice that if I add another col (called "time" and run the apps (via alt or play icon in studio), the new col does not appear in the value property unless I select a different col in it's list to refresh the list, then select the newly added col (e.g. time). This is probably not a bug but does seem to point to how the value property doesn't always pick up the new cols.

I suspect on my real app, I have a lot of calcuations going on in AddColumns to create the collection so the value property list is not able to pick it up new cols so it only lists the ones prior to addcols being called.

 

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,028)