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

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
Highlighted
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
Highlighted
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

Highlighted
Post Patron
Post Patron

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response 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 (7,573)