cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Community Support

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
Highlighted
Anonymous
Not applicable

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
Community Support

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,831)