cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Save action removes part of record in input gallery

OK folks, got another weird one.

 

I have a gallery with three input text boxes and a save icon/button that I'm using to compile a collection of a list of items.  The first item is saved to the collection without issues, but when I input the second item/row and click save, the first input text boxes blanks out.  Not only that, but if you try to re-enter what was in it and submit it, it still doesn't show up in SPO list (this is a customized form fyi).  A quick example.  So, the three inputs I have are Item, Description, and Quantity.  So, if you type this...

 

Item            Description            Quantity

Monitor      NEC                        4                    SAVE

 

...and click Save, it's fine.  The line is saved to the collection, and a new line is created in the collection/gallery.  

BUT, if you try to enter a another item (this happens to every item after the first)....

 

Item            Description          Quantity

Monitor      NEC                      4                    SAVE

Keyboard    Logitech              5                     SAVE

 

..and click Save, the first field disappears.

 

Item            Description          Quantity

Monitor      NEC                      4                    SAVE

                   Logitech              5                     SAVE

 

Here is the code for initializing the collection from the app's OnStart property:

ClearCollect(col_ItemDetail, {Item: "", Description: "", Quantity: 0})

 

Here is the code from the Save icon/button's OnSelect property:

Patch(col_ItemDetail, ThisItem, {Item: ItemVal.Text, Description: DescripVal.Text, Quantity: Value(QuantityVal.Text)}); Collect(col_ItemDetail, {Title: "", Description: "", Quantity: 0})

 

Please help.  I've been going over and over this, but can't see what would be causing this behavior.  If anyone needs more information, just ask.  I'd be happy to oblige.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Save action removes part of record in input gallery

@lumberjacklurch 

Since you are replacing the entire record with the values in the gallery textboxes, you might want to consider changing your formula on the save button to this:

Update(col_ItemDetail, 
ThisItem,
{Item: ItemVal.Text, Description: DescripVal.Text, Quantity: Value(QuantityVal.Text)}
);

Collect(col_ItemDetail, {Title: "", Description: "", Quantity: 0})

This should work for you.  I hope it is helpful.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Save action removes part of record in input gallery

@lumberjacklurch 

Since you are replacing the entire record with the values in the gallery textboxes, you might want to consider changing your formula on the save button to this:

Update(col_ItemDetail, 
ThisItem,
{Item: ItemVal.Text, Description: DescripVal.Text, Quantity: Value(QuantityVal.Text)}
);

Collect(col_ItemDetail, {Title: "", Description: "", Quantity: 0})

This should work for you.  I hope it is helpful.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Re: Save action removes part of record in input gallery

Awesome!  Thanks RandyHayes!  I wonder why Patch exhibits that behavior.  Smiley Frustrated 


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
Users Online
Currently online: 291 members 5,813 guests
Please welcome our newest community members: