cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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 III
Super User III

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 III
Super User III

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

Power Platform Community Conference

Check out the on demand sessions that are available now!

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

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

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