Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Text input values disappear inside Gallery



I am building an inventory app which needs to be able to count products stored in multiple locations.  Within the app I have a collection, a gallery and three input fields inside the gallery.  

Through PatchUpdateContext and possibly one other way to add the values entered into the text box I am able to ammend the total inventory counted.  My problem is this: 
Every time I navigate away from the field inside the gallery, my value(s) disappear.  

I have attached the code to OnSelect & OnChange; changed the default to "", [blank], false, and anything else I can think of.  Any help would be much appreciated. 


General Idea of App: 

In Gallery - User enters values.

Apples:  10 on the floor; 5 near cash register; 30 apples in backroom. 

Oranges:  8 on floor; 3 near cash; 100 in back room. 


In Collection:  

Name: / Inv: 

Apples / 45

Oranges / 111




Super User
Super User

Re: Text input values disappear inside Gallery


Can you possibly supply a picture of your screen to get a better idea about what you are trying to put together?

That will help in understanding the issue better.

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.
Level: Powered On

Re: Text input values disappear inside Gallery



1 - Thank you very much for your question and any help you can provide.


2 -

Please find the attached screen shot of my Collection and the Gallery. It is a bit messy as I have tried a number of workarounds, some of which are better than others.  


At the top: 
Apple:   Input Box= 12; Input Box = 45

Code attached to each box: 

Patch(InventoryCollection, {Name: "Apple"}, {Inv: (fridgeAppleText + ovrstockAppleText)})

This successfully adds the values of the inventory to the collection, however, it would require me to build and rename new text input fields for each new item.  I would prefer to build a dynamic option which will display each item in a gallery.  


Dynamic Solution:

The Gallery.

Title:  Name of Item
Subtitle:  Inventory

Input box 1, 2 3:  Location(s) where inventory is kept. 


Code attached to OnChange of Input boxes:

Patch(InventoryCollection, {Name: Title4.Text},{ Inv: FridgeInvTxt+OverStock2txt+OvrStock1txt})


What happens:  

Collection updates - Value in text input box disappears / reverts to default values.  I have tried to disable the default values, insert null string, assign false value.  







Helpful resources


Power Apps Super User Class of 2020

Check it out!


New Badges

Check it out!


Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


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


Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,761)