cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
esemuhdeoh
Level: Powered On

Dropdown will get reset in gallery when adding item to Collection

I am trying to create a purchase requisition form. User can choose a categorie (Dropdown1) and then the list of articles is filtered (Dropdown2). Automatically the price of that article is looked up and will also be displayed. The user then can enter the number of articles he/she wants to buy and the end price is calculated. 

All of this is entered in an item of a gallery. When hitting "save" the item will be added to the collection (via "patch") and with "collect" a new item in the gallery is added, so that another item can be selected (if the user wants to buy another item).

(Big THX goes out to Shane Young for his videos - in this case the videos regarding repeating tables!!!)

 

Everything works fine. Problem is: As soon as I hit "save" a new item is added to the gallery BUT the first item will get reset to the default value. The selected value will get patched to the collection, but in the frontend (in the gallery) you cannot see what you just added.

Any help with this? I did not interfere with the "reset"-settings.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: Dropdown will get reset in gallery when adding item to Collection

Hi @esemuhdeoh ,

The reason why you met this problem is that the gallery's Selected Item is the first item by default.

When you click the patch button, the selecting action will be invalid. So your gallery's selecteditem will change to the first item by default.

I suggest you save the item that you just selected as a collection before you perform patch function.

For example: 

ClearCollect(test, gllery.selected);Patch(...)

Set the gallery's Default to:

First(test)

 

Then, your patch action will not affect the gallery's selected item.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Wackmack88
Level 8

Re: Dropdown will get reset in gallery when adding item to Collection

Hi,

 

I have just build an app with repeating tables. Can you show the code for updating the collection?

Highlighted
Community Support Team
Community Support Team

Re: Dropdown will get reset in gallery when adding item to Collection

Hi @esemuhdeoh ,

The reason why you met this problem is that the gallery's Selected Item is the first item by default.

When you click the patch button, the selecting action will be invalid. So your gallery's selecteditem will change to the first item by default.

I suggest you save the item that you just selected as a collection before you perform patch function.

For example: 

ClearCollect(test, gllery.selected);Patch(...)

Set the gallery's Default to:

First(test)

 

Then, your patch action will not affect the gallery's selected item.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

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,396)