cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ColinM
Frequent Visitor

Text input values disappear inside Gallery

Hi, 

 

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

 

 

 

2 REPLIES 2
RandyHayes
Super User III
Super User III

@ColinM 

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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi,

 

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.  

 

Thanks,

Colin

 

@RandyHayes 

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,988)