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

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

Re: Gallery format that allows updates

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
Level 10

Re: Gallery format that allows updates

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
Level 10

Re: Gallery format that allows updates

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

iskhj000
Level: Powered On

Re: Gallery format that allows updates

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

Highlighted
iskhj000
Level: Powered On

Re: Gallery format that allows updates

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,025)