I have a gallery where I will be updating 2 text fields that I need to save back to the data source. I have created a collection (colCapacity) that grabs the records that will be updated
App On Start:
ClearCollect(
colCapacity,
Filter(
AddColumns(
'CAPACITY TRACKER',
"_mainid",
'CAPACITY TRACKER ID',
"_month",
'Capacity Date LookUp'.'Capacity Month Date',
"_name",
'Capacity Resource LookUp'.'Resource Name - Outlook',
"_id",
'Capacity Main LookUp'.'PR ID',
"_projectname",
'Capacity Main LookUp'.'Project Name',
),
'Owning Manager Detail Tracker'.'Full Name' = User().FullName
)
)
)
Gallery 1
I have 2 fields that will be updated, on each field I have the OnChange set to Select(Parent)
The Gallery 1 OnSelect property is set to:
Patch(
colCapacity,
ThisItem,
{'Forecast Capacity': Value(forecastValue.Text)},
{'Accrual Capacity ': Value(accrualValue.Text)}
)
When I make updates, I can see the items being updated correctly in the Collection.
Save Button
I have a ‘Save’ button, that when pressed, needs to submit all of the changes from the collection.
I have the OnSelect of the save button set to:
Patch('CAPACITY TRACKER',colCapacity)
But get the error, invalid argument type (Table) expected record value instead
Solved! Go to Solution.
Hi @todaytoo ,
The first issue I see is that your Collect code (the bottom item) will not work as the added columns do not exist in the data source. One way to fix is the "long" way (assuming you are creating new records here)
ForAll(
colCapacity As aPatch,
Patch(
'CAPACITY TRACKER',
{
FieldName1: aPatch.FieldName1,
FieldName2: aPatch.FieldName2,
. . . . . .
}
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hi @todaytoo ,
The first issue I see is that your Collect code (the bottom item) will not work as the added columns do not exist in the data source. One way to fix is the "long" way (assuming you are creating new records here)
ForAll(
colCapacity As aPatch,
Patch(
'CAPACITY TRACKER',
{
FieldName1: aPatch.FieldName1,
FieldName2: aPatch.FieldName2,
. . . . . .
}
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
User | Count |
---|---|
260 | |
110 | |
97 | |
56 | |
40 |