web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Text input values disa...
Power Apps
Unanswered

Text input values disappear inside Gallery

(1) ShareShare
ReportReport
Posted on by 26

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

 

 

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @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.

  • ColinM Profile Picture
    26 on at

    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 

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard