cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
esemuhdeoh
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
v-yutliu-msft
Community Support
Community Support

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

Hi,

 

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

v-yutliu-msft
Community Support
Community Support

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (82,044)