cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iskhj000
Helper I
Helper I

Gallery format that allows updates

I am trying to create an inventory sheet.  1st screen allows them to pick where they are doing the invenotry.  2nd screen show the items in a list format (gallery) and a quantitiy field for them to fill out.  I can't seem to get the quantity field to be updatable in that list  format. Does anyone have any suggestions and if so any sample code?  I am new to this applicaiton.

5 REPLIES 5
TerjeF
Advocate III
Advocate III

Hi

What's your datasource?  I would download f.i. SiteInspection demo app, and learn from that. If you give some more input (screen shots etc), it would be easier to give you a direction and/or solutions to this...  🙂

hpkeong
Community Champion
Community Champion

HI

 

Are you using EditForm? If yes, then there should be a field to fill in.

If you are using normal TextInput, then you shall use

- Patch(TableX, Defaults(TableX), {FieldTitle: TextInput.Text,...}) - for New Records or

- Patch(TableX, ContextVariable, {as above"), where ContextVariable is brought over from previous screen which you may write lie this:

- OnSelect (of any gallery items) = Navigate(Screen1, Fade, {EditX: ThisItem}), whre EditX is any name assigned as a ContextVariabe.

 

Hope this helps.

hpkeong
Steelman70
Power Participant
Power Participant

I have managed to do what you need, the juice is in the last three steps.

 

Say your data source is Test_transactions which has three colums:

  1. Locations: A text or choice column with the name of the location
  2. Title: A text or choice column with the name of the widget (inventory item)
  3. Inventory_amount: A number column with the number of items in inventory for that widget for that location

Create a new blank app

 

Rename the first screen Locations and create a second screen and rename it Inventory_edit

 

Connect your data source, it should be automatically called Test_transactions

 

Here are the essential steps with the screen Locations

  1. Insert a vertical custom gallery and change its name to Gallery_locations
  2. Set its Items property to GroupBy(Test_transactions, "Locations", "AllItems")
  3. Insert in the gallery a text box and change its name to TextBox_location
  4. Set its Text property to ThisItem.Locations
  5. Insert in the same gallery a right-arrow shape and set its OnSelect property to Navigate(Inventory_edit, Transition.None)

Here are the essential steps with the screen Inventory_edit

  1. Insert a back arrow shape and set its OnSelect property to Back(ScreenTransition.None)
  2. Insert a vertical custom gallery
  3. Set its Items property to Sort( Filter(Test_transactions, Locations = Gallery_locations.Selected.TextBox_location.Text), Title)
  4. Insert in the gallery a text box and set its Text property to ThisItem.Title
  5. Insert in the gallery a text input control (not a text box), it should be called TextInput1 by default
  6. Set the Default property of TextInput1 to ThisItem.Inventory_amount
  7. Set the OnChange property of Textinput1 to Patch(Test_transactions, ThisItem, {Inventory_amount: Value(TextInput1.Text)}) 

This lacks the check if TextInput1 is numerical (if it isn't then the record will not be updated, assuming Inventory_quantity is of numerical type, but no error will be thrown) and if any other errors in connection happen etc. but you can add those as described in other posts and articles.

 

Please let me know if this works and if so please mark as answer.

 

See screenshots below...

 

Capture_A.PNG

 

Capture_B.PNG

 

 

 

PS hpkeong's answer also works, but it requires the opening of each item in an edit form.  As of today it does not seem that you can add edit forms as elements of a gallery

OMGosh I am sooo excited - I can' wait to try this out!!!!

 

Unfortunately I just finished volunteering at a Red Crosss shelter all night and will have to work on this later tonight..... this is sooo cool  

 

Thank you sooo much.  I will report back when done tomorrow.  Smiley LOL

I finally go to stop and read and If I undertand the comments right they still have to click on each one.  Is that correct?
Im still trying to do this but I am very VERY GREEN and its taking me along time

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (70,785)