@R3dKap wrote:
Hi @PowerAid,
Your post (probably) makes sense but it's a bit hard here to figure out exactly your situation :). A screen capture showing us the various elements you describe would be very helpfull.
Waiting for your feedback...
My PowerApp is a budget proposal form. It connected to a Master Sharepoint list that stores each request and it also has a secondary list that stores all of the child entries for the repeating table. I am using a gallery as the interface for the repeating table. The home screen has a button called Create new Budget proposal. OnSelect, it creates a new collection for the repeating table. Here is the code:
NewForm(Form1);ClearCollect(RevenuePreDefinedCollection, {CategoryCC: "", AmountEachCC: 0, QuantityCC: 0, SubtotalCC: 0}) ;Navigate(NewItem,ScreenTransition.Cover)
The columns in this collection corespond to the text inputs in the repeating table (gallery). There is a Save icon next to each gallery entry. It has the following code:
Patch(RevenuePreDefinedCollection, ThisItem, {CategoryCC: DropdownPreDeifinedCategories.Selected.Value, AmountEachCC: Value(TextInputAmountEach.Text), QuantityCC: Value(TextInputQuantity.Text), SubtotalCC: Value(TextInputSubtotal.Text)}); Collect(RevenuePreDefinedCollection, {CategoryCC: "Select...", AmountEachCC: 0, QuantityCC: 0, SubtotalCC: 0})
Then once you have all of your revenue entries added, you click on the main Save button which writes the form to SharePoint and writes the child entries to the details list. The code for the Save button is: SubmitForm.Form1
The OnSuccess of the form is where the main code comes into play. It looks like this:
ForAll(Filter(RevenuePreDefinedCollection,CategoryCC<>"Select..."), Patch('Revenue Pre-Defined Categories', Defaults('Revenue Pre-Defined Categories'), {Title: CategoryCC, AmountEach: AmountEachCC, Quantity: QuantityCC, Subtotal: SubtotalCC, MasterID: Form1.LastSubmit.ID}))
I have attached some screen shots to help explain this. The Default values of the text inputs in the gallery have to be set to the coresponding columns in the collection. Then the collection writes the values to the details sharepoint list(RevenuePreDefinedCollection). My issue is that I need the subtotal text input to be Amount*Quantity. I would normally place that in the Default property of Subtotal but that is where I have the collection column SubtotalCC.